Trading Venues Split
Every market order routes through Drake's intelligent execution system that splits flow between two venues:
Onchain Order Book
The order book maintains limit orders using efficient Red-Black Tree data structures organized by price level:
Limit Buy Orders: Sorted from highest to lowest (best bid on top)
Limit Sell Orders: Sorted from lowest to highest (best ask on top)
Stop Orders: Separate trees for long and short stop-losses
Take-Profit Orders: Dedicated trees for profit-taking triggers
When a market order arrives, the matching engine:
Finds the best available price (highest bid for sells, lowest ask for buys)
Matches taker volume against resting maker orders
Applies price-time priority (older orders at same price fill first)
Continues matching through price levels until order is filled
Charges maker rebates (negative fees) and taker fees
AMM Vault
The AMM vault provides continuous liquidity by quoting prices based on oracle feeds:
Pricing: Oracle mid-price ± configured spread
Execution: Instant fills at quoted price for allocated portion
Capacity: Fills absorb residual volume when order book lacks depth
Counterparty: Vault takes opposite side of trader positions
Last updated