Learn
Curve

Curve

Swap

  • Label: Swap_Curve
  • Description: Swap a token to get another in exchange in Curve.
  • Actions in execution process:
    1. Swap SELL_TOKEN to get BUY_TOKEN in exchange.

SELL_TOKEN · approve

Approve TargetPool  to spend SELL_TOKEN tokens on behalf of the avatar.

  • Contract: SELL_TOKEN

  • Function: approve(address,uint256)

    ParameterConstraint
    spenderTargetPool 
    amountequal to the SELL_TOKEN amount to swap

Note: If ETH is SELL_TOKEN, the approve function is skipped.

TargetPool · exchange

Swap dx amount of SELL_TOKEN tokens for as much as possible of BUY_TOKEN tokens.

  • Contract: TargetPool
  • Function: exchange(int128,int128,uint256,uint256)
ParameterConstraint
iequal to SELL_TOKEN index
jequal to BUY_TOKEN index
dxequal to SELL_TOKEN amount
min_dyequal to minimum amount of BUY_TOKEN to receive