Skip to content

Overview

What Kuru is

Kuru is an on-chain orderbook protocol for fully collateralized Spot markets and margin-aware perpetuals. Users fund a shared AccountCore, which owns custody, account permissions, routing, and fee policy. Market-specific FIFO orderbooks perform matching without holding user tokens: Spot settles against reserved balances, while quote-specific PerpEngines manage margin, positions, funding, health, open interest, and liquidation.

Product features

  • Native order flow: GTC, IOC, FOK, and post-only limit orders, exact-input Spot swaps, batch cancellation, and packed slot replacement for market makers.
  • Reduce-at-block orders: an order can set minSizeAfterBlock. After that block passes, matching caps its executable amount to the smaller of its stored size and the market's minimum executable size. The order stays live; it is not an expiry or automatic cancellation.
  • Passive Spot liquidity: reserve-backed price bands provide synthetic depth, with shares and spread-fee growth tracked separately from active orders.
  • Post-fill hooks: a Spot maker can attach a gas-bounded hook that runs when a resting order is fully removed. It can replenish the filled slot, replace an opposite-side quote, or do both. Invalid hook output is discarded without reverting the completed fill.
  • One-click and automated execution: scoped signer permissions, EIP-712 intents, and EIP-7702 delegated trading wallets support relayed Spot actions, packed market-making updates, and standing triggers without moving custody into the integration layer.
  • Perpetual risk management: quote-specific Engines support cross and isolated margin, reduce-only orders, funding, position and open-interest limits, health checks, and liquidation.

Why this architecture

Kuru gives users one account and permission layer across Spot and perpetuals while keeping free balance, Spot reserves, passive inventory, cross margin, and isolated margin as distinct economic claims. Deterministic FIFO matching and atomic settlement make execution auditable; shared custody avoids placing assets in individual market contracts; and bounded, revalidated hooks give market makers automation without allowing a failed callback to undo a valid trade.

Continue with system architecture for state ownership, Spot markets or perpetual markets for product flows, and terminology and units before implementing an integration.

Reduce-at-block depth

Spot getL2Book can temporarily report the full stored size after minSizeAfterBlock passes, even though matching and swap estimation apply the executable-size cap. Clients that require executable Spot depth must apply the same block-aware cap.