Lighter is ZKDepth's public perp and hedge venue: the perps on the Trade page and the shorts behind the hedged vaults trade there. To give you orders without a wallet popup for each one, a ZKDepth service called the signer holds an order key for your Lighter account.
Who holds which key
Your wallet authorises a Lighter API key once. The API checks each write's signature, forwards it and holds no key. The signer stores your order key encrypted and accepts calls only from the API.
Connect your Lighter account
- 1Open a Lighter accountLighter creates your account with its first deposit, at least 1 USDG through Lighter's bridge. The USDG never passes through ZKDepth, and Lighter credits it a few minutes later. A smart-contract wallet is refused, because Lighter cannot verify its signature on the key change.
- 2Request a keyThe Bind order key button signs a request. The signer generates one keypair per address, stores it encrypted, and returns the text your wallet must sign.
- 3Sign and bindYour wallet signs that text, and the signer submits the key change to Lighter.
How an order is priced
The signer signs an order only if every check passes:
- The address is onboarded and its key is bound.
- Lighter has a current mark for the market.
- A limit order uses your price and rests for up to 28 days. A market order uses the mark plus or minus the requested slippage, never under 100 bps. A request over 1,000 bps is refused, not clamped.
- That price is within 1,000 bps of the mark, whichever order type produced it.
- The size meets the market's minimum unless the order is reduce-only, and size times mark is at most $250,000.
The app sends no slippage value, so every market order from the Perp form is priced at 1 %. The form's liquidation price is ZKDepth's cross-margin estimate, not Lighter's own figure. The band limits each order, not how many are sent.
Exit orders
A stop loss or take profit is Lighter's own conditional order, and it triggers with your browser closed. Every exit is reduce-only, triggered by Lighter's mark price, executes no more than 1 % beyond the trigger, and expires after 28 days. With a new entry, exits are sized to what the entry actually filled. A gap or a thin book can leave part of a position open after a trigger.
Signed requests
Every write to /perp/* carries a one-time nonce, a timestamp within 300 s and an EIP-712 signature over a hash of the request body, so a signature fits exactly one body. /perp/withdraw-intent returns an unsigned description for your wallet to sign and submit.
Trading sessions
Signing every order in your wallet is the default. Turn on Trade without confirming each order and pick 1 hour, 8 hours or 24 hours. The browser generates a key for this tab, and your wallet signs one grant for it, naming order and cancel and an end time.
Until the session ends, anyone with access to this tab can place and cancel perp orders for your wallet inside the signer's band and cap. A session can never withdraw or bind a key. End session revokes the grant at the API. Closing the tab discards the key, and the grant lapses at its expiry.
ZKDepth fee mode
Your wallet chooses between two modes. Zero-fee mode charges nothing. ZKDepth fee mode adds 1 bp on taker fills through Lighter's partner program. It needs your account on Lighter's Plus tier and your approval of ZKDepth's fee account, and those fills earn points. The owner switches it on with PERP_FEE_ENABLED.
Prices and funding
Marks, volume, open interest and funding for 58 markets come from Lighter through the API, cached for 15 s. Where Lighter has no mark, other public price sources fill the gap. Lighter settles funding every hour, and at a positive rate longs pay shorts. The funding chart annualises the settled rate as simple interest (rate × 8,760). ZKDepth's own on-chain engine is in Perps.
services/signer/app/main.pyonboard, bind, order and its checksservices/signer/app/config.pythe floor, ceiling, band and notional capapps/api/src/routes/perp.tsthe /perp/* routes and the signed envelope