Pool
Manages deposits, withdrawals and swaps. Holds a mapping of assets and parameters.
Last updated
Manages deposits, withdrawals and swaps. Holds a mapping of assets and parameters.
Last updated
contracts/wombat-core/pool/Pool.sol
Title: Pool
Notice: Manages deposits, withdrawals and swaps. Holds a mapping of assets and parameters.
Details: The main entry-point of Wombat protocol Note: All variables are 18 decimals, except from that of underlying tokens
***Pool.AssetAdded(token, asset) ***
Notice: An event thats emitted when an asset is added to Pool
Arguments
***Pool.AssetRemoved(token, asset) ***
Notice: An event thats emitted when asset is removed from Pool
Arguments
***Pool.Deposit(sender, token, amount, liquidity, to) ***
Notice: An event thats emitted when a deposit is made to Pool
Arguments
***Pool.FillPool(token, amount) ***
Arguments
***Pool.OwnershipTransferred(previousOwner, newOwner) ***
Arguments
***Pool.Paused(account) ***
Arguments
***Pool.PausedAsset(asset, account) ***
Arguments
***Pool.SetAmpFactor(value) ***
Arguments
***Pool.SetDev(addr) ***
Arguments
***Pool.SetFee(lpDividendRatio, retentionRatio) ***
Arguments
***Pool.SetFeeTo(addr) ***
Arguments
***Pool.SetHaircutRate(value) ***
Arguments
***Pool.SetMasterWombat(addr) ***
Arguments
***Pool.SetMintFeeThreshold(value) ***
Arguments
***Pool.Swap(sender, fromToken, toToken, fromAmount, toAmount, to) ***
Notice: An event thats emitted when a swap is made in Pool
Arguments
***Pool.TransferTipBucket(token, amount, to) ***
Arguments
***Pool.Unpaused(account) ***
Arguments
***Pool.UnpausedAsset(asset, account) ***
Arguments
***Pool.Withdraw(sender, token, amount, liquidity, to) ***
Notice: An event thats emitted when a withdrawal is made from Pool
Arguments
***Pool.addAsset(token, asset) ***
Notice: Adds asset to pool, reverts if asset already exists in pool
Arguments
Pool.addressOfAsset(token) view
Notice: Gets Asset corresponding to ERC20 token. Reverts if asset does not exists in Pool.
Details: to be used externally
Arguments
Outputs
Pool.ampFactor() view
Notice: Amplification factor
Outputs
***Pool.deposit(token, amount, minimumLiquidity, to, deadline, shouldStake) ***
Notice: Deposits amount of tokens into pool ensuring deadline
Details: Asset needs to be created and added to pool before any operation. This function assumes tax free token.
Arguments
Outputs
Pool.dev() view
Notice: Dev address
Outputs
Pool.exchangeRate(token) view
Notice: Returns the exchange rate of the LP token
Arguments
Outputs
Pool.feeTo() view
Outputs
***Pool.fillPool(token, amount) ***
Arguments
Pool.getTokens() view
Notice: Return list of tokens in the pool
Outputs
Pool.globalEquilCovRatio() view
Outputs
Pool.haircutRate() view
Notice: Haircut rate
Outputs
***Pool.initialize(ampFactor_, haircutRate_) ***
Notice: Initializes pool. Dev is set to be the account calling this function.
Arguments
Pool.lpDividendRatio() view
Notice: LP dividend ratio : the ratio of haircut that should distribute to LP
Outputs
Pool.masterWombat() view
Outputs
***Pool.mintFee(token) ***
Notice: Send fee collected to the fee beneficiary
Arguments
Pool.mintFeeThreshold() view
Notice: The threshold to mint fee (unit: WAD)
Outputs
Pool.owner() view
Details: Returns the address of the current owner.
Outputs
***Pool.pause() ***
Details: pause pool, restricting certain operations
***Pool.pauseAsset(token) ***
Details: pause asset, restricting deposit and swap operations
Arguments
Pool.paused() view
Details: Returns true if the contract is paused, and false otherwise.
Outputs
Pool.quoteAmountIn(fromToken, toToken, toAmount) view
Notice: Returns the minimum input asset amount required to buy the given output asset amount (accounting for fees and slippage)
Details: To be used by frontend
Arguments
Outputs
Pool.quotePotentialDeposit(token, amount) view
Notice: Quotes potential deposit from pool
Details: To be used by frontend
Arguments
Outputs
Pool.quotePotentialSwap(fromToken, toToken, fromAmount) view
Notice: Given an input asset amount and token addresses, calculates the maximum output token amount (accounting for fees and slippage).
Details: In reverse quote, the haircut is in the
fromAsset
Arguments
Outputs
Pool.quotePotentialWithdraw(token, liquidity) view
Notice: Quotes potential withdrawal from pool
Details: To be used by frontend
Arguments
Outputs
Pool.quotePotentialWithdrawFromOtherAsset(fromToken, toToken, liquidity) view
Notice: Quotes potential withdrawal from other asset from the pool
Details: To be used by frontend
Arguments
Outputs
***Pool.removeAsset(token) ***
Notice: Removes asset from asset struct
Details: Can only be called by owner
Arguments
***Pool.renounceOwnership() ***
Details: Leaves the contract without owner. It will not be possible to call
onlyOwner
functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
Pool.retentionRatio() view
Notice: Retention ratio: the ratio of haircut that should stay in the pool
Outputs
***Pool.setAmpFactor(ampFactor_) ***
Notice: Changes the pools amplification factor. Can only be set by the contract owner.
Arguments
***Pool.setDev(dev_) ***
Notice: Changes the contract dev. Can only be set by the contract owner.
Arguments
***Pool.setFee(lpDividendRatio_, retentionRatio_) ***
Arguments
***Pool.setFeeTo(feeTo_) ***
Notice: Changes the fee beneficiary. Can only be set by the contract owner. This value cannot be set to 0 to avoid unsettled fee.
Arguments
***Pool.setHaircutRate(haircutRate_) ***
Notice: Changes the pools haircutRate. Can only be set by the contract owner.
Arguments
***Pool.setMasterWombat(masterWombat_) ***
Arguments
***Pool.setMintFeeThreshold(mintFeeThreshold_) ***
Notice: Set min fee to mint
Arguments
***Pool.swap(fromToken, toToken, fromAmount, minimumToAmount, to, deadline) ***
Notice: Swap fromToken for toToken, ensures deadline and minimumToAmount and sends quoted amount to
to
address
Details: This function assumes tax free token.
Arguments
Outputs
Pool.tipBucketBalance(token) view
Arguments
Outputs
***Pool.transferOwnership(newOwner) ***
Details: Transfers ownership of the contract to a new account (
newOwner
). Can only be called by the current owner.
Arguments
***Pool.transferTipBucket(token, amount, to) ***
Arguments
***Pool.unpause() ***
Details: unpause pool, enabling certain operations
***Pool.unpauseAsset(token) ***
Details: unpause asset, enabling deposit and swap operations
Arguments
***Pool.withdraw(token, liquidity, minimumAmount, to, deadline) ***
Notice: Withdraws liquidity amount of asset to
to
address ensuring minimum amount required
Arguments
Outputs
***Pool.withdrawFromOtherAsset(fromToken, toToken, liquidity, minimumAmount, to, deadline) ***
Notice: Enables withdrawing liquidity from an asset using LP from a different asset
Arguments
Outputs