Skip to content
/lethra/

// docs · how it works, in full

Exactly what is private, and what is not.

Lethra runs on a public chain, so it is worth being exact. Everything below is what the code and the contract do today.

What Lethra is

A visibility check. For a real order or trade on Robinhood Chain it shows what three parties can read (you, the party in the middle, and the public) before you sign, once it is broadcast, once it is in a block, and after each fill. Three sources: swaps on Robinhood Chain pools, decoded from their own calldata and logs (Pools); the perp venue's public API (Perps); and Lethra's own sealed desk, a contract where a resting order's size and limit stay off the chain until a slice fills (Spot).

How a sealed order travels

You seal it. Your browser cuts the order into 1 to 8 slices of uneven size. Each slice is (side, amount, price, counterparty or anyone, a random salt). Each is hashed into a leaf; random padding leaves fill the tree to 8, so the number of real slices does not show. A separate hash commits to (side, total size, limit, root, salt).

You post the root. post() sends the two tokens, a cover for each (what you escrow), the root, the terms hash and an expiry. A sell order needs base cover of at least its size; a buy order needs quote cover of at least size times limit. You may add extra cover so the cover does not equal the size, and a decoy in the other token so the side does not show. Both come back in full when you cancel.

You hand out slices. A slice ticket is a link holding one slice and its Merkle proof, nothing else. You decide who gets which.

A counterparty fills. fill() reveals that slice; the contract checks the proof against your root, the named counterparty if any, that the slice is not over-filled, that the cover holds enough and that the order is open and not expired. Then it moves the tokens: your cover pays the counterparty, the counterparty pays you at the slice's exact price, in the same transaction.

You cancel whenever you like. cancel() closes the order and returns all remaining cover to you, before or after expiry.

What stays private

  • The total size, until every slice has been touched.
  • The limit price (only a hash of it is on chain). A touched slice shows its own price.
  • The number of slices.
  • The side, if you cover both tokens, until the first fill.
  • The remaining size: the public sees only the cover still escrowed, which bounds it.
  • Untouched slices, forever, unless you share them.

Your sealed orders live in your browser's storage. Lethra's server never receives them. Copy an order's JSON to keep it elsewhere: without it, nobody (you included) can open the terms.

What is public

  • At post(): your address, the two tokens, both cover amounts, the root, the terms hash and the expiry.
  • At each fill: the counterparty's address, that slice's side, full amount, price and taker field, the amount filled and the quote moved.
  • At cancel: the cover returned.
  • A slice ticket is readable by whoever holds it; a ticket for anyone can be filled by anyone who sees it.

Before a transaction is in a block, your wallet's RPC provider and the chain's sequencer hold it in full. Robinhood Chain has no public pending pool that we could read (txpool_content and pending filters answer "method not available" on the official RPC, checked 1 Dec 2026).

Swaps and the perp venue

An AMM swap has no sealed part: the direction, the full input, your minimum out (and so your slippage setting), the recipient and the deadline are in its calldata. Lethra decodes calls to Uniswap V2 Router, Uniswap SwapRouter02, Universal Router (v4 PoolManager 0x8366…0951), Pons Universal Router; for any other target it says it cannot name the fields and shows what the logs moved.

The perp venue keeps its own order book. Its public endpoints (https://api.rh.lighter.xyz) list each resting order with its account number, full size, remaining size, price and expiry, and each trade with both account numbers and the taker's and maker's position size before it. Lethra reads them on its server and shows them as they come; it does not trade there.

Who can do what

  • The order's owner can cancel it and take all remaining cover back at any time. Nothing else.
  • A counterparty holding a slice can fill up to that slice's amount at its price, if it is named or the slice is open to anyone. It cannot change the price, the amount or the recipient.
  • Anyone can read every order's public face and every fill.
  • Nobody else: the contract has no owner, admin, fee, pause or upgrade. No function moves a cover except a fill at the owner's own slice price or the owner's cancel.

Limits

  • ERC-20 tokens only; native ETH is not accepted (use WETH). Tokens that take a fee on transfer are refused, measured at every transfer in.
  • Orders rest at most 90 days. The owner cannot fill its own order.
  • Matching is not automatic: you choose counterparties and give them slices. Lethra runs no matcher.
  • This is new code. Start with small amounts.
  • Not financial advice. Lethra does not tell you whether to trade.

Contracts and sources

desk
LethraSealedDesk, not deployed yet
default pair
WETH 0x0bd7d308f8e1639fab988df18a8011f41eacad73 / USDG 0x5fc5360d0400a0fd4f2af552add042d716f1d168
routers
Uniswap V2 Router 0x89e5db8b5aa49aa85ac63f691524311aeb649eba · Uniswap SwapRouter02 0xcaf681a66d020601342297493863e78c959e5cb2 · Universal Router (v4 PoolManager 0x8366…0951) 0x53bf6b0684ec7ef91e1387da3d1a1769bc5a6f77 · Pons Universal Router 0x8876789976decbfcbbbe364623c63652db8c0904
v4 pools
PoolManager 0x8366a39cc670b4001a1121b8f6a443a643e40951
perp venue
https://api.rh.lighter.xyz (public, no key)
machine
/api/proof · /api/health · llms.txt

The coin

$LETHRA is the project's token, not launched yet. Nothing on this site needs it. Its planned feature, credits for reports that compare the visibility of many order scenarios at once, is a Concept and is not built. See the token page.