Return the current position for the market at marketIndex
in UI units
e.g. if you buy 1 BTC in the UI, you're buying 1,000,000 native BTC,
10,000 BTC-PERP contracts and exactly 1 BTC in UI
Find the marketIndex in the ids.json list of perp markets
This is the init health divided by quote decimals
Return the equity in standard UI numbers. E.g. if equity is $100, this returns 100
Return the spot, perps and quote currency values after adjusting for worst case open orders scenarios. These values are not adjusted for health type
Amount of native quote currency available to expand your position in this market
Return the spot, perps and quote currency values after adjusting for worst case open orders scenarios, using a price modifier. These values are not adjusted for health type.
Take health components and return the assets and liabs weighted using a price modifier
deposits - borrows in native terms
Calculates the exposure for each spot asset and perp contract in standard UI numbers. E.g. if a user has net borrowed $100, and is long 10,000 MNGO contracts this would return: [{asset: "USDC", symbol: "USDC", amount: -100, value: -100}, {asset: "MNGO-PERP", symbol: "MNGO", amount: 10000, value: 2000}] All perp markets that are active for the mango group need to be loaded before calling this method and can passed in arbitrary order.
Return the open orders keys in basket and replace open orders not in basket with zero key
Return the open orders keys in basket; no zero keys; useful for PlaceSpotOrder2 and PlacePerpOrder2
Get all the open orders using only info in MangoAccount; Does not contain information about the size of the order.
Return the current position for the market at marketIndex
in UI units
e.g. if you buy 1 BTC in the UI, you're buying 1,000,000 native BTC,
10,000 BTC-PERP contracts and exactly 1 BTC in UI
Find the marketIndex in the ids.json list of perp markets
Take health components and return the assets and liabs weighted
Get the value of unclaimed MNGO liquidity mining rewards
Generated using TypeDoc
Get token amount available to withdraw without borrowing.