Page cover image

Introduction

Tycho Orderbook is an application based on a Rust SDK and Tycho, currently deployed at orderbook.wtf.

This application bridges the gap between centralised exchanges orderbooks and the onchain liquidity complex structure.

Key points

  • Reconstructs on-chain AMM liquidity as a CEX-style orderbook using Tycho

  • Enables fast, executable trades via Rust SDK, with precomputed orderbook structure across all major pools

  • Makes on-chain markets readable, tradable, and aggregatable in real-time with CEX-like precision ad format.

  • As a developer/trader, used to centralised order books, you can use this SDK to read liquidity and execute swaps (with custom solver) on any pair of tokens with liquidity pools, with an orderbook interface ⇒ see SDK

  • As a DeFi user, you can read and understand the liquidity depth for any pair of tokens, and run your own local instance of the stack ⇒ Run in local

Why Tycho Orderbook ?

In DeFi, liquidity is typically provided by AMMs, which use continuous formulas to distribute liquidity, unlike orderbooks that aggregate discrete limit orders. Despite their differences, both approaches ultimately produce strictly increasing supply curves.

The key insight is that if onchain liquidity can be seen as a strictly increasing supply curve, it’s possible to replicate that curve with a series of limit orders.

By running simulations (with Tycho Simulation tool), one can derive the incremental supply—essentially, the price levels at which liquidity is available—and then reconstruct an equivalent orderbook.

There are many reasons for building such a tool

  1. Bring more traders on-chain: In the familiar format of an orderbook, on-chain liquidity will be easier to read and execute over for a wider set of traders. This can bring new traders, e.g. those with existing strategies for orderbook markets, to use on-chain liquidity.

  2. Strengthen on-chain liquidity: Making on-chain liquidity more accessible can increase on-chain volumes, and consequently revenues, and incentivise deeper on-chain liquidity, and the resulting deeper books further incentivises more on-chain trading through better prices.

  3. Aggregate liquidity: Another high barrier for traders to trade efficiently against on-chain liquidity is to use the liquidity fragmented over different pools and protocols. A unified orderbook also abstracts the different protocols and pools – and presents them in a unified form.

  4. Save time: Unless you have a specifically optimised setup – its hard to do all the simulations required for running sophisticated trading strategies (e.g. determining the supply for 1000 different tokens at 10 different trading volumes). A unified orderbook includes pre-simulated trade amounts that traders can use directly, or as a starting point for "final mile" simulations.

It is illustrated by the following graphs. An orderbook presents discrete limit orders with an increasing quantity offered, while an AMM offers continuous liquidity.

Orderbooks and AMMs both present strictly increasing trade supply curves.

Since no single liquidity pool fully represents all on-chain liquidity, a router or solver can be used to gather the best price at any depth across various pools, ultimately building an aggregate on-chain liquidity book (Uniswap, Curve, etc).

Aggregate on-chain liquidity

Doing so, we can recalculate, or approximate, all the data in a centralised orderbook, but for all onchain liquidity. It transposes an classic orderbook (executable via API) like the following ⇒

Caption todo

To an onchain liquidity orderbook (also executable with a wallet and the Rust SDK) like this

This reconstructed orderbook allows traders to:

  • Visualise the shape of on-chain liquidity

  • Make informed trade decisions based on precise price levels

  • Query the expected price for a given trade size or the available depth at a specific price

Notes

Under the hood, Tycho Simulation can simulate trades across any liquidity pool in microseconds.

Moreover, with Tycho Execution, we can convert any market order on this synthetic onchain orderbook into onchain calldata, enabling execution with a wallet.

An important caveat is that gas costs can cause the supply curve to deviate slightly from being strictly increasing. Unlike traditional orderbooks where costs scale proportionally. Gas fees introduce discrete jumps—especially noticeable at very small trade amounts or when new liquidity pools (or ticks) are added. You'll see them if you zoom in.

Initially, these costs can worsen the price before improving it as the trade size increases, adding a layer of complexity to the simulated orderbook.

Last updated

Was this helpful?