State Variables
tbc
Functions
constructor
constructorinitializePool
This is the function to initialize the pool.simulateLiquidityDeposit
This is the function to simulate a liquidity deposit into the pool.
Returns
tokenDepositUpdate
depositLiquidity
If the tokenId provided is owned by the lp, this tokenId will be updated based on liquidity deposit This is the function to deposit liquidity into the pool.
Returns
simulateWithdrawLiquidity
This is the function to simulate a liquidity withdrawal from the pool. To get rj and uj, call the getLPToken function and pass in the rj and uj values
Returns
withdrawPartialLiquidity
This is the function to withdraw partial liquidity from the pool.withdrawAllLiquidity
This is the function to withdraw all token liquidity from the pool._withdrawLiquidity
This is the function to withdraw liquidity from the pool._emitLiquidityWithdrawn
This is the function to emit the LiquidityWithdrawn event.withdrawRevenue
This is the function to withdraw revenue from the pool.
Returns
revenueAvailable
This is the function to get the revenue available for a liquidity position.
Returns
_getRevenueAvailable
This is the function to get the revenue available for a liquidity provider.
Returns
_spotPrice
x + 1 is used for returning the price of the next token sold, not the price of the last token sold This is the function to retrieve the current spot price of the x token._updateParameters
This function updates the state of the math values of the pool._calculateAmountOfXRequiredBuyingY
This function calculates the amount of token X required for the user to purchase a specific amount of Token Y (buy y with x : out perspective).
Returns
_calculateAmountOfYRequiredBuyingX
This function calculates the amount of token Y required for the user to purchase a specific amount of Token X (buy x with y : out perspective).
Returns
_calculateAmountOfYReceivedSellingX
This function calculates the amount of token Y the user will receive when selling token X (sell x for y : in perspective).
Returns
_calculateAmountOfXReceivedSellingY
This function calculates the amount of token X the user will receive when selling token Y (sell y for x : in perspective).
Returns