Module hydra_dx_math::lbp[][src]

Functions

Calculating buying price given reserve of selling asset and reserve of buying asset. Formula :

Calculating weight at any given block in an interval using linear interpolation.

Calculating selling price given reserve of selling asset and reserve of buying asset. Formula : BUY_RESERVE * AMOUNT / (SELL_RESERVE + AMOUNT )

Calculating spot price given reserve of selling asset and reserve of buying asset. Formula : BUY_RESERVE * AMOUNT / SELL_RESERVE

Type Definitions