📦SDKs
Libraries for computing Ekubo quotes, working with pool math, and encoding swap routes
Ekubo publishes three libraries. All of them implement the same protocol math, so quotes computed off-chain match on-chain execution exactly.
All three cover both Starknet and EVM deployments where the underlying math is shared.
Rust: ekubo_sdk
The Rust SDK is the most complete implementation — it is what powers Ekubo's own routing. It exists primarily to compute quotes from Ekubo pools, plus the supporting protocol math.
[dependencies]
ekubo_sdk = { version = "3.2", features = ["evm"] }The crate is no_std-compatible, which makes it usable in constrained environments. Select what you need with feature flags:
std (default) / no_std
Standard library or libm-backed math; exactly one must be enabled
evm
EVM types via alloy-primitives (v1 by default; evm-alloy-0_6 pins v0.6)
starknet
Starknet felt types via starknet-types-core
serde
Serialization for the protocol types
Three modules:
math— tick and sqrt-ratio conversions, swap step computation, deltas, fixed-point helpers, and TWAMM mathquoting— the quoting engine: aPooltrait with aquotemethod,QuoteParams/Quote/TokenAmounttypes, andPoolKey/PoolConfig/Tickdefinitionschain— the EVM and Starknet type mappings
The quoting::pools module implements every pool type and extension so that off-chain quotes account for extension behavior: concentrated, full_range, stableswap, limit_order, mev_capture, twamm, oracle, ve33, spline, and boosted_fees variants. This is the practical reason to prefer the Rust SDK for routing — replicating extension behavior by hand is where most integrations go wrong (see Aggregators).
TypeScript: @ekubo/sdk
Shared math and protocol encoding utilities, with no runtime dependencies. It covers the pieces most integrations need in a browser or Node environment:
Tick and price math — conversions between ticks, sqrt ratios, and prices for both chains (see Price representation)
Liquidity math —
maxLiquidityForTokenAmounts,liquidityToAmountBase/liquidityToAmountQuote,amountsFromSpecifiedAmount, and theamount0Delta/amount1Deltaprimitives for sizing positionsSwap math —
computeStep,computeFee,amountBeforeFee,nextSqrtRatioFromAmount0/nextSqrtRatioFromAmount1TWAMM math —
calculateNextSqrtRatiofor DCA poolsPool key and protocol encoding for EVM
Chain constants —
EVM_MIN_TICK/EVM_MAX_TICK(±88,722,835),EVM_MAX_TICK_SPACING,EVM_MIN_SQRT_RATIO/EVM_MAX_SQRT_RATIO, and the Starknet equivalents (±88,722,883)
@ekubo/sdk is published as an alpha. Pin an exact version, and expect the surface to change before a stable release.
TypeScript: @ekubo/yul-router-sdk
Encodes calldata for the Yul Router, the router used for Ekubo swaps on EVM chains. Use it to turn a route — typically one returned by the Quoter API — into a transaction. See the Yul Router guide for the full surface and worked examples.
Last updated
Was this helpful?

