Skip to content

Commit

Permalink
Merge pull request #123 from balancer/mkflow27/issue11
Browse files Browse the repository at this point in the history
Guides, onchain query warnings review
  • Loading branch information
mkflow27 authored Jul 4, 2024
2 parents 54f1342 + 1fd7ffa commit 31a3ddf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/integration-guides/guides/add-liquidity-to-pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ const tx = await router.addLiquidityUnbalanced(

The following code snippet shows how to add liquidity from a smart contract.

::: warning Queries cannot be used within the same block to set minBptAmountOut due to possible manipulation
::: warning Queries should not be used onchain to set minAmountOut due to possible manipulation via frontrunning.
:::

```solidity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ const tx = await router.removeLiquidityProportional(

The following code snippet shows how to remove liquidity from a smart contract.

::: warning Queries cannot be used within the same block to set minAmountsOut due to possible manipulation
::: warning Queries should not be used onchain to set minAmountOut due to possible manipulation via frontrunning.
:::

```solidity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ const tx = await router.swapSingleTokenExactIn(

#### Solidity

::: warning Queries cannot be used within the same block to set minAmountOut due to possible manipulation
::: warning Queries should not be used onchain to set minAmountOut due to possible manipulation via frontrunning.
:::

```solidity
Expand Down Expand Up @@ -584,7 +584,7 @@ const tx = await router.swapExactIn(

#### Solidity

::: warning Queries cannot be used within the same block to set minAmountOut due to possible manipulation
::: warning Queries should not be used onchain to set minAmountOut due to possible manipulation via frontrunning.
:::

```solidity
Expand Down
2 changes: 1 addition & 1 deletion docs/integration-guides/guides/swaps-for-aggregators.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ swapFeePercentage =

[Queries](../../concepts/router/queries.md) provide the ability to simulate an operation and find its result without executing a transaction. Balancer Routers provide a query for all state changing liquidity operations including single and multi-path swap functions, e.g. `querySwapSingleTokenExactIn`. The following sections link to examples showing how queries can be used.

::: warning Note - for onchain integrations queries cannot be used to set limits within the same block due to possible manipulation
::: warning Note - for onchain integrations queries should not be used to set limits due to possible manipulation via frontrunning.
:::

### Single Swaps
Expand Down

0 comments on commit 31a3ddf

Please sign in to comment.