ICronV1Relayer
IMPORTANT: pool addresses and ids for all calls are determined by the Cron-Finance TWAMM Factory contract,
preventing access to other types of pools in the Balancer Vault for additional safety.swap
function swap(address _tokenIn, address _tokenOut, uint256 _poolType, uint256 _amountIn, uint256 _minTokenOut, address _recipient) external returns (bytes swapResult) The slippage specified in basis points is used to determine how much token out can be lost relative
to a trade occuring at the current reserve ratio. If the amount of token out is more than the slippage
percent different than the ideal amount calculated by the current reserve ratio, the trade reverts.
A recipient can be specified if the proceeds of the trade are to be directed to an account different
from the calling account, msg.sender.
IMPORTANT: Users must approve this contract on the Balancer Vault before any transactions can be used.
This can be done by calling setRelayerApproval on the Balancer Vault contract and specifying
this contract's address.
Checks performed on behalf of a user include:
- Pool specified by token in and out addresses and pool type exists.
- Pool has been funded and contains minimum liquidity amounts.
- Swap amount specified is greater than zero and available in the calling account (msg.sender).
- Trade results in amount of token out within specified slippage percent of the ideal amount
calculated from the ratio of the pool's virtual reserves.
Checks NOT performed for a user include:
- Validity / sanity of the recipient address.Parameters
Name
Type
Description
Return Values
Name
Type
Description
join
Parameters
Name
Type
Description
Return Values
Name
Type
Description
exit
Parameters
Name
Type
Description
Return Values
Name
Type
Description
longTermSwap
Parameters
Name
Type
Description
Return Values
Name
Type
Description
withdraw
Parameters
Name
Type
Description
Return Values
Name
Type
Description
cancel
Parameters
Name
Type
Description
Return Values
Name
Type
Description
getPoolAddress
Parameters
Name
Type
Description
Return Values
Name
Type
Description
getOrder
Parameters
Name
Type
Description
Return Values
Name
Type
Description
getLibrary
Return Values
Name
Type
Description
getVault
Return Values
Name
Type
Description
Last updated