Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 3.1 KB

rmm-sdk.ipool.md

File metadata and controls

45 lines (32 loc) · 3.1 KB

Home > @primitivefi/rmm-sdk > IPool

IPool interface

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Abstraction of a Primitive RMM Pool

Signature:

export interface IPool 

Remarks

State includes reserves and calibration, just as a pool in PrimitiveEngine.sol does.

Properties

Property Type Description
expired boolean (BETA) True if Date.now() in seconds is greater than maturity timestamp.
inTheMoney boolean (BETA) True if strike is below referencePriceOfRisky.
invariant FixedPointX64 (BETA) Trading function invariant of the Pool, formatted as Q64.64
lastTimestamp Time (BETA) Timestamp of last curve update.
liquidity Wei (BETA) Total liquidity of Pool, including the min liquidity IEngine.MIN_LIQUIDITY.
premium number (BETA) Theoretical call option premium, computed using the pool's calibration data.
referencePriceOfRisky Wei (BETA) Gets stored reference price of IEngine.risky, denominated in IEngine.stable.
remaining Time (BETA) Difference between maturity timestamp and the current timestamp returned by Date.now().
reportedPriceOfRisky Wei (BETA) Gets the reported price CFMM for the IEngine.risky token, denominated in the IEngine.stable token.
reserveRisky Wei (BETA) Risky token reserves of IEngine.risky.
reserveStable Wei (BETA) Stable token reserves of IEngine.stable.
tau number (BETA) Difference between maturity timestamp and lastTimestamp.

Methods

Method Description
getCurrentLiquidityValue(priceOfRisky, priceOfStable) (BETA) Gets the current value of the pool denominated in units of priceOfRisky.
liquidityQuote(amount, sideOfPool) (BETA) Computes other side(s) of pool and/or liquidity amount, given a known size of one side of the pool.