deepbookv3-query-the-pool
Installation
SKILL.md
DeepBook V3: Query the Pool
DeepBook V3 exposes rich read-only query APIs. These functions allow developers and trading bots to fetch order book depth, simulate trades (dry runs), query user balances, fetch pool configurations, and check pre-trade parameters.
1. Primary Query APIs
Order Book Depth (Level 2)
- Range-Based Depth: Returns price and quantity vectors within a specified price range.
getLevel2Range(pool, price_low, price_high, is_bid) - Tick-Based Depth: Returns bid/ask prices and quantities up to a specified number of ticks.
getLevel2Ticks(pool, ticks)
Swap Simulations (Dry Runs)
- Quote for Base (Exact Base): Get simulated quote output and DEEP fee for a given base asset input.
- Base for Quote (Exact Quote): Get simulated base output and DEEP fee for a given quote asset input.
- Generic Dry Run: Simulates swap exact amount and returns
(base_out, quote_out, deep_fee_required). - Reverse Dry Run: Simulates the exact input required to obtain a specific target output.