Skip to main content

Module asset

Module asset 

Source
Expand description

Asset ids: the integer an order names its market by. Ids run perps on the main dex below 10000, spot pairs from 10000, HIP-3 perps from 100000 and HIP-4 outcomes from 100000000, so an id alone says what it names, and so which builder cap holds it.

Structs§

Asset
An asset id. Made from the index it is counted from, so a pair index is never sent where an asset id belongs; an index past its range is refused rather than spilling into the next kind’s ids.

Enums§

AssetKind
What an asset id names.
OutcomeSide
A HIP-4 outcome’s side, the last digit of its encoding.

Constants§

HIP3_ASSET_BASE
Where HIP-3 perps begin: 100000 + dex * 10000 + index, dex the dex’s place in perpDexs, where the main dex is 0.
HIP3_DEX_SPAN
How many ids each HIP-3 dex spans.
OUTCOME_ASSET_BASE
Where HIP-4 outcomes begin: 100000000 + 10 * outcome + side.
SPOT_ASSET_BASE
Where spot pairs begin: 10000 + pair index.