Expand description
Orderbook and tick level management for the stablecoin DEX.
Modulesยง
Structsยง
- Orderbook
- Orderbook for token pair with price-time priority Uses tick-based pricing with bitmaps for price discovery
- Orderbook
Handler - Type-safe handler for accessing
#struct_namein storage. - Tick
Level - Represents a price level in the orderbook with a doubly-linked list of orders Orders are maintained in FIFO order at each tick level
- Tick
Level Handler - Type-safe handler for accessing
#struct_namein storage.
Constantsยง
- MAX_
PRICE_ ๐POST_ MODERATO - MAX_
PRICE_ ๐PRE_ MODERATO - MAX_
TICK - MIN_
PRICE_ ๐POST_ MODERATO - MIN_
PRICE_ ๐PRE_ MODERATO - MIN_
TICK - Constants from Solidity implementation
- PRICE_
SCALE
Functionsยง
- compute_
book_ key - Compute deterministic book key from base, quote token pair
- price_
to_ tick_ post_ moderato - Convert scaled price to relative tick post moderato hardfork
- price_
to_ tick_ pre_ moderato - Convert scaled price to relative tick pre moderato hardfork
- tick_
to_ price - Convert relative tick to scaled price