Skip to main content

Module perps

Module perps 

Source
Expand description

Perps on every dex, the main one and HIP-3 ones alike: meta and contexts, margin tables and funding.

Re-exports§

pub use funding::FUNDING_INTERVAL_MS;
pub use funding::FUNDING_PAGE;
pub use funding::FUNDING_WINDOW_MS;
pub use funding::FundingDelta;
pub use funding::FundingRate;
pub use funding::HL_PERP;
pub use funding::PredictedFunding;
pub use funding::PredictedFundings;
pub use funding::UserFunding;
pub use funding::VenueFunding;
pub use funding::funding_history;
pub use funding::funding_history_range;
pub use funding::funding_history_request;
pub use funding::funding_windows;
pub use funding::merge_rates;
pub use funding::next_funding;
pub use funding::next_page;
pub use funding::predicted_fundings;
pub use funding::predicted_fundings_request;
pub use funding::user_funding;
pub use funding::user_funding_range;
pub use funding::user_funding_request;
pub use meta::Meta;
pub use meta::MetaAndAssetCtxs;
pub use meta::PerpAsset;
pub use meta::PerpCtx;
pub use meta::meta;
pub use meta::meta_and_asset_ctxs;
pub use meta::meta_and_asset_ctxs_request;
pub use meta::meta_request;
pub use meta::perps_at_open_interest_cap;
pub use meta::perps_at_open_interest_cap_request;
pub use meta::underlying;
pub use table::FLAT_TABLES_BELOW;
pub use table::MarginTable;
pub use table::MarginTier;

Modules§

funding
Funding: settled rates (fundingHistory), an account’s payments (userFunding) and the next predicted rates (predictedFundings). Both histories answer at most FUNDING_PAGE rows, so a long range is read in windows (funding_windows) or pages (next_page).
meta
meta, metaAndAssetCtxs and perpsAtOpenInterestCap for any perp dex: the main dex, or a HIP-3 dex by name. A perp’s asset id counts from its dex’s place in perpDexs, the main dex at 0. Fields an order or a market view does not need are left unread.
table
Margin tables: how much leverage a position may take at each size. meta lists the tiered ones; an id under FLAT_TABLES_BELOW is a single tier at that leverage and never listed.