πSwap
CxRouter
Cross-Chain swap contract allows users to execute aggregated swaps with external factories
constructor
CxSwap
Cross-Chain swap contract allows users to deposit liquidity and execute aggregated swaps with external factories
constructor
_addLiquidity
Internal function to Add Liquidity to the selected pool
Parameters
tokenA
address
address of first token to add
tokenB
address
address of second token to add
amountADesired
uint256
specifies the amount of tokens that should be added as liquidity
amountBDesired
uint256
specifies the amount of tokens that should be added as liquidity
amountAMin
uint256
specifies the minimum amount of first token that this transactions should succeed with
amountBMin
uint256
specifies the minimum amount of second token that this transactions should succeed with
addLiquidity
Add liquidity to the selected pool
Parameters
tokenA
address
address of first token to add
tokenB
address
address of second token to add
amountADesired
uint256
specifies the amount of tokens that should be added as liquidity
amountBDesired
uint256
specifies the amount of tokens that should be added as liquidity
amountAMin
uint256
specifies the minimum amount of first token that this transactions should succeed with
amountBMin
uint256
specifies the minimum amount of second token that this transactions should succeed with
to
address
address to send liquidity tokens to
deadline
uint256
timestamp after which this transaction will be reverted
removeLiquidity
Remove liquidity from the selected pool
Parameters
tokenA
address
address of first token to remove
tokenB
address
address of second token to remove
liquidity
uint256
specifies the amount of LP tokens that should be removed from liquidity pool
amountAMin
uint256
specifies the minimum amount of first token that this transactions should succeed with
amountBMin
uint256
specifies the minimum amount of second token that this transactions should succeed with
to
address
address to send tokens to
deadline
uint256
timestamp after which this transaction will be reverted
quote
given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
Parameters
amountA
uint256
specifies the amount of first token
reserveA
uint256
specifies the reserves amount of first token
reserveB
uint256
specifies the reserves amount of second token
Last updated