State Variables
FLOAT_2
FLOAT_NEG_1
FLOAT_0
FLOAT_1
FLOAT_WAD
Functions
calculateBn
The result will be a packedFloat Bn is equal to V / (Xn + C) in the spec This function calculates B(n) and stores it in the tbc definition as b.calculatefx
The result for f(x) will be a packedFloat. This equation is used to calculate the spot price of the x token and is equal to (bn * x) + cn This function calculates f(x) at n.
Returns
calculateDn
The result for Dn will be a packedFloat This equation is used to calculate the area under the curve at n and is equal to (1/2)(bnx^2) + cnx This function calculates D at n.
Returns
calculateH
This method is implemented using packedFloats and the float128 library This equation in the spec is equal to (Ln + Zn) / (Wn - wInactive) + phi This function calculates h at n which is the total revenue per unit of liquidity at time n.
Returns
calculateXofNPlus1
This method is implemented using packedFloats and the float128 library This equation in the spec is equal to 2Dn / (c + sqrt(c^2 + 2bDn)) This function calculates the value of Xn+1.
Returns
calculateC
This function calculates the parameter c and stores it in the tbc definition.calculateLastRevenueClaim
The result for last revenue claim will be a Float. This function calculates the last revenue claim to be stored in the associated LPToken variable rj. The result will be a WAD value.calculateL
This function calculates the parameter L.
Returns
calculateZ
This function calculates the parameter Z, which is a balancing quantity used to ensure fair LP accounting.calculateQ
This function calculates q.
Returns
calculateRevenueAvailable
This function calculates the revenue available for a given LPToken.
Returns
_liquidityUpdateHelper
This function updates related tbc variables when a liquidity deposit or withdrawal is made
Returns