SwapUtils
Functions:
Events:
Function calculateWithdrawOneToken(struct SwapUtils.Swap self, uint256 tokenAmount, uint8 tokenIndex) → uint256
calculateWithdrawOneToken(struct SwapUtils.Swap self, uint256 tokenAmount, uint8 tokenIndex) → uint256Parameters:
Return Values:
Function getVirtualPrice(struct SwapUtils.Swap self) → uint256
getVirtualPrice(struct SwapUtils.Swap self) → uint256Parameters:
Return Values:
Function calculateSwap(struct SwapUtils.Swap self, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) → uint256 dy
calculateSwap(struct SwapUtils.Swap self, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx) → uint256 dyParameters:
Return Values:
Function calculateRemoveLiquidity(struct SwapUtils.Swap self, uint256 amount) → uint256[]
calculateRemoveLiquidity(struct SwapUtils.Swap self, uint256 amount) → uint256[]Parameters:
Return Values:
Function calculateTokenAmount(struct SwapUtils.Swap self, uint256[] amounts, bool deposit) → uint256
calculateTokenAmount(struct SwapUtils.Swap self, uint256[] amounts, bool deposit) → uint256Parameters:
Return Values:
Function getAdminBalance(struct SwapUtils.Swap self, uint256 index) → uint256
getAdminBalance(struct SwapUtils.Swap self, uint256 index) → uint256Parameters:
Return Values:
Function swap(struct SwapUtils.Swap self, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy) → uint256
swap(struct SwapUtils.Swap self, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 dx, uint256 minDy) → uint256Parameters:
Return Values:
Function addLiquidity(struct SwapUtils.Swap self, uint256[] amounts, uint256 minToMint) → uint256
addLiquidity(struct SwapUtils.Swap self, uint256[] amounts, uint256 minToMint) → uint256Parameters:
Return Values:
Function removeLiquidity(struct SwapUtils.Swap self, uint256 amount, uint256[] minAmounts) → uint256[]
removeLiquidity(struct SwapUtils.Swap self, uint256 amount, uint256[] minAmounts) → uint256[]Parameters:
Return Values:
Function removeLiquidityOneToken(struct SwapUtils.Swap self, uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount) → uint256
removeLiquidityOneToken(struct SwapUtils.Swap self, uint256 tokenAmount, uint8 tokenIndex, uint256 minAmount) → uint256Parameters:
Return Values:
Function removeLiquidityImbalance(struct SwapUtils.Swap self, uint256[] amounts, uint256 maxBurnAmount) → uint256
removeLiquidityImbalance(struct SwapUtils.Swap self, uint256[] amounts, uint256 maxBurnAmount) → uint256Parameters:
Return Values:
Function withdrawAdminFees(struct SwapUtils.Swap self, address to)
withdrawAdminFees(struct SwapUtils.Swap self, address to)Parameters:
Function setAdminFee(struct SwapUtils.Swap self, uint256 newAdminFee)
setAdminFee(struct SwapUtils.Swap self, uint256 newAdminFee)Parameters:
Function setSwapFee(struct SwapUtils.Swap self, uint256 newSwapFee)
setSwapFee(struct SwapUtils.Swap self, uint256 newSwapFee)Parameters:
Event TokenSwap(address buyer, uint256 tokensSold, uint256 tokensBought, uint128 soldId, uint128 boughtId)
TokenSwap(address buyer, uint256 tokensSold, uint256 tokensBought, uint128 soldId, uint128 boughtId)Event AddLiquidity(address provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)
AddLiquidity(address provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)Event RemoveLiquidity(address provider, uint256[] tokenAmounts, uint256 lpTokenSupply)
RemoveLiquidity(address provider, uint256[] tokenAmounts, uint256 lpTokenSupply)Event RemoveLiquidityOne(address provider, uint256 lpTokenAmount, uint256 lpTokenSupply, uint256 boughtId, uint256 tokensBought)
RemoveLiquidityOne(address provider, uint256 lpTokenAmount, uint256 lpTokenSupply, uint256 boughtId, uint256 tokensBought)Event RemoveLiquidityImbalance(address provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)
RemoveLiquidityImbalance(address provider, uint256[] tokenAmounts, uint256[] fees, uint256 invariant, uint256 lpTokenSupply)Event NewAdminFee(uint256 newAdminFee)
NewAdminFee(uint256 newAdminFee)Event NewSwapFee(uint256 newSwapFee)
NewSwapFee(uint256 newSwapFee)Last updated
Was this helpful?
