SwapUtils
Functions:
Events:
Function getA(struct SwapUtils.Swap self) → uint256
getA(struct SwapUtils.Swap self) → uint256Parameters:
Return Values:
Function getAPrecise(struct SwapUtils.Swap self) → uint256
getAPrecise(struct SwapUtils.Swap self) → uint256Parameters:
Return Values:
Function getDepositTimestamp(struct SwapUtils.Swap self, address user) → uint256
getDepositTimestamp(struct SwapUtils.Swap self, address user) → uint256Parameters:
Return Values:
Function calculateWithdrawOneToken(struct SwapUtils.Swap self, address account, uint256 tokenAmount, uint8 tokenIndex) → uint256, uint256
calculateWithdrawOneToken(struct SwapUtils.Swap self, address account, uint256 tokenAmount, uint8 tokenIndex) → uint256, 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, address account, uint256 amount) → uint256[]
calculateRemoveLiquidity(struct SwapUtils.Swap self, address account, uint256 amount) → uint256[]Parameters:
Return Values:
Function calculateCurrentWithdrawFee(struct SwapUtils.Swap self, address user) → uint256
calculateCurrentWithdrawFee(struct SwapUtils.Swap self, address user) → uint256Parameters:
Return Values:
Function calculateTokenAmount(struct SwapUtils.Swap self, address account, uint256[] amounts, bool deposit) → uint256
calculateTokenAmount(struct SwapUtils.Swap self, address account, 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, bytes32[] merkleProof) → uint256
addLiquidity(struct SwapUtils.Swap self, uint256[] amounts, uint256 minToMint, bytes32[] merkleProof) → uint256Parameters:
Return Values:
Function updateUserWithdrawFee(struct SwapUtils.Swap self, address user, uint256 toMint)
updateUserWithdrawFee(struct SwapUtils.Swap self, address user, uint256 toMint)Parameters:
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:
Function setDefaultWithdrawFee(struct SwapUtils.Swap self, uint256 newWithdrawFee)
setDefaultWithdrawFee(struct SwapUtils.Swap self, uint256 newWithdrawFee)Parameters:
Function rampA(struct SwapUtils.Swap self, uint256 futureA_, uint256 futureTime_)
rampA(struct SwapUtils.Swap self, uint256 futureA_, uint256 futureTime_)Parameters:
Function stopRampA(struct SwapUtils.Swap self)
stopRampA(struct SwapUtils.Swap self)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)Event NewWithdrawFee(uint256 newWithdrawFee)
NewWithdrawFee(uint256 newWithdrawFee)Event RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime)
RampA(uint256 oldA, uint256 newA, uint256 initialTime, uint256 futureTime)Event StopRampA(uint256 currentA, uint256 time)
StopRampA(uint256 currentA, uint256 time)Last updated
Was this helpful?