For the complete documentation index, see llms.txt. This page is also available as Markdown.

๐ŸงฉIntegrating Ekubo

The different ways to integrate Ekubo Protocol, and production integrations you can use as reference implementations

There are several ways to integrate Ekubo, depending on what you're building.

1. Swap on-chain from a smart contract

Every interaction with Ekubo goes through the Core singleton's lock callback pattern: call lock, receive a callback, perform swaps and settle net token amounts at the end. See Swapping for the flow. On EVM, production swaps go through the gas-optimized Yul Router with routes encoded by @ekubo/yul-router-sdk; the Router contracts (Starknet, EVM) are reference implementations for building your own.

2. Quote Ekubo liquidity off-chain (aggregators, solvers)

To route trades through Ekubo pools you need to simulate swaps off-chain. The easiest path is the Quoter API, which returns block-pinned split routes ready to execute. To compute quotes yourself, use the SDKs โ€” the Rust SDK implements every pool type and extension โ€” or see Price representation and Pool math to implement the math directly. Remember that pools with extensions can modify swap behavior; see the Aggregators guide for how to handle them safely.

3. Index Ekubo data

The open source indexer ingests Ekubo events on any supported chain into Postgres โ€” it is the same code that powers the Ekubo API. Run your own instance for low-latency or high-volume needs.

4. Connect an AI agent

The public MCP server at mcp.ekubo.org exposes quoting, pool and position data, and unsigned execution plans to any MCP-capable agent.

5. Provide exclusive, quoted liquidity

Market makers can run RFQ-style pools where each swap is signed off-chain with its own fee and bounds, while still settling in Ekubo Core โ€” see Signed exclusive swaps.

SDKs

ekubo_sdk (Rust) computes quotes across every pool type; @ekubo/sdk provides pool math in TypeScript; @ekubo/yul-router-sdk encodes swap routes for EVM execution. See SDKs.

Reference integrations

Production integrations of Ekubo you can use as working examples:

Integration
Language
What it shows
Ekubo code

Go

Aggregator pool discovery, state tracking, and swap simulation

TypeScript

Aggregator integration with on-chain quoting and event-based state

Rust

Substreams-based indexing and off-chain swap simulation of Ekubo V3

Questions about an integration? Ask in the Ekubo Discord.

Last updated

Was this helpful?