ALTBCPool
Git Source Inherits: PoolBase, ALTBCCalculator Author: @oscarsernarosero @mpetersoCode55 @cirsteve This contract serves the purpose of facilitating swaps between a pair of tokens, where one is an xToken and the other one is a yToken.Functions
constructor
constructor| Name | Type | Description |
|---|---|---|
_xToken | address | address of the X token (x axis) |
_yToken | address | address of the Y token (y axis) |
fees | FeeInfo | fee infomation |
_tbcInput | ALTBCInput | input parameters for the TBC |
_liquidityRemovalAllowed | bool | if true, liquidity can be removed at any time. Removal of liquidity forbidden otherwise. |
sender | address | address of the to-be owner |
enableSwaps
Only the owner of the pool can call this function. This is the function to activate/deactivate trading.| Name | Type | Description |
|---|---|---|
_enable | bool | pass True to enable or False to disable |
yTokenLiquidity
This function gets the liquidity in the pool for yToken in WAD| Name | Type | Description |
|---|---|---|
<none> | uint256 | the liquidity in the pool for yToken in WAD |
withdrawRevenue
Only the owner can call this function. This function allows the owner of the pool to pull accrued revenue from the Pool.closePool
This function can be called only if the flag liquidityRemovalAllowed was set to true at construction time and the msg sender is the owner. This function closes the pool by removing all liquidity from it._validateLiquidityAdd
yBalance will include LPFees, Q and yLiquidity the first parameter is not used, but it is required by the base class. We can use the stored value of x. This function validates the liquidity addition to ensure it does not exceed the max supply of xToken.| Name | Type | Description |
|---|---|---|
<none> | uint256 | |
afterBalance | uint256 | the balance of xToken after the addition |