Skip to content

View the Orderbook

Query and inspect the orderbook to see available liquidity, price levels, and individual orders on Tempo's Stablecoin DEX.

Recommended Approach

We recommend using indexed data to query the orderbook for better performance and ease of use. While you can query logs and transactions directly from an RPC node, indexed data providers offer structured SQL interfaces that make complex queries simpler and more efficient.

In this guide, we use Index Supply as our indexing provider, but you're free to choose your own indexing solution or query the chain directly based on your needs.

Recipes

Get the current spread

Query the best bid and ask prices to calculate the current spread for a token pair.

Find the highest bid prices (buyers) for AlphaUSD. This query filters out fully filled and cancelled orders, groups by price level (tick), and shows the top 5 bid prices with their total liquidity.

Best Bid Prices for AlphaUSD

Signatures
OrderPlaced
FlipOrderPlaced
OrderFilled
OrderCancelled
Loading...

Find the lowest ask prices (sellers) for AlphaUSD. The spread is the difference between the highest bid and lowest ask price.

Best Ask Prices for AlphaUSD

Signatures
OrderPlaced
FlipOrderPlaced
OrderFilled
OrderCancelled
Loading...

Inspect order depth

View aggregated liquidity at each price level to understand the orderbook structure.

This query shows all active orders from both OrderPlaced and FlipOrderPlaced events for BetaUSD.

BetaUSD Order Depth by Price Level

Signatures
OrderPlaced
FlipOrderPlaced
OrderFilled
OrderCancelled
Loading...

Inspect an individual order

Order details

Get detailed information about a specific order including its placement details, fill history, and cancellation status.

This query inspects the details of the most recent order for AlphaUSD. It shows when the order was created, at what price (tick), the order size, and who placed it.

Order Placement Details

Signatures
OrderPlaced
Loading...

Order fill status

Check if an order has been partially or fully filled. This query shows up to 5 fill events for order number 2, including the amount filled in each transaction and whether it was a partial fill.

Order Fill History

Signatures
OrderFilled
Loading...

Cancelled orders

Check if an order has been cancelled. This query returns an order for AlphaUSD that was explicitly cancelled by the maker before being fully filled.

Order Cancellation Status

Signatures
OrderCancelled
OrderPlaced
Loading...

Get recent trade prices

View the last prices a token traded at to understand recent market activity.

This query joins order fill events with their corresponding placement details to show the price tick and amount for recent trades.

Recent Trade Prices for AlphaUSD

Signatures
OrderFilled
OrderPlaced
FlipOrderPlaced
Loading...