assets, in native quote
token cumulative interest, in native token units. Sum of deposit and borrow interest. Caveat: This will only return cumulative interest since the tokenPosition was last opened. If the tokenPosition was closed and reopened multiple times it is necessary to add this result to cumulative interest at each of the prior tokenPosition closings (from mango API) to get the all time cumulative interest.
Health, see health.rs or https://docs.mango.markets/mango-markets/health-overview
raw health number, in native quote
Health ratio, which is computed so 100 * (assets-liabs)/liabs
Note: health ratio is technically ∞ if liabs are 0
health ratio, in percentage form
Health ratio
health ratio, in percentage form, capped to 100
Sum of all negative assets.
liabs, in native quote
TODO: also think about limit orders
The max ui base you can place a market/ioc ask on the market, price is the ui price at which you think the order would materialiase.
max ui base ask
TODO REWORK, know to break in binary search, also make work for limit orders
maximum ui base which can be traded at oracle price for quote token given current health
TODO: also think about limit orders
The max ui quote you can place a market/ioc bid on the market, price is the ui price at which you think the order would materialiase.
maximum ui quote which can be traded at oracle price for quote token given current health
TODO REWORK, know to break in binary search, also make work for limit orders
maximum ui quote which can be traded at oracle price for base token given current health
The max amount of given source ui token you can swap to a target token.
max amount of given source ui token you can swap to a target token, in ui token
The amount of given native token you can withdraw including borrows, considering all existing assets as collateral.
amount of given native token you can borrow, considering all existing assets as collateral, in native token
TODO: take into account net_borrow_limit and min_vault_to_deposits_ratio
Overall PNL, in native quote PNL is defined here as spot value + serum3 open orders value + perp value - net deposits value (evaluated at native quote price at the time of the deposit/withdraw) spot value + serum3 open orders value + perp value is returned by getEquity (open orders values are added to spot token values implicitly)
UI balance for a token, is signed
UI borrows for a token, 0 or less
UI deposits for a token, 0 or more
health ratio after an ask with uiBaseAmount is placed
health ratio after a bid with uiQuoteAmount is placed
Simulates new health ratio after applying tokenChanges to the token positions. Note: token changes are expected in ui amounts
e.g. useful to simulate health after a potential swap. Note: health ratio is technically ∞ if liabs are 0
health ratio, in percentage form
Generated using TypeDoc
Sum of all positive assets.