Trade
Docs kit

Kit

Docs kit

Every component a docs page can use.

This page is the site's own sample of every component a docs page can use. Pages in content/docs/ use them without importing anything. The calls in the code blocks show the components, not the API: the API pages hold the real calls.

Code

A fenced block gets a language label and a copy control. A leading $ on shell lines is dropped from what is copied.

Shell
$ npm install
$ npm run build
TypeScript
import { FEES } from '@/lib/facts'

const takerFee = (notional: number) => (notional * FEES.takerBps) / 10_000

The same call, each way

<Ways> holds one <Way label="…"> per way the product offers. The reader's choice is remembered across pages.

TypeScript
const fill = await client.example({ market: 'SOL-PERP' })

Steps

  1. Open the invite link

    The code is stored in the browser and bound to the wallet you connect.

  2. Enable trading

    The wallet signs one message for a session key that lasts 7 days.

  3. Claim test USDC

    Season Zero credits 10,000 test USDC once per wallet per day.

Fields

Fields from lib/facts.ts
FieldTypeDescription
makerBpsnumberMaker fee in basis points: 0.
takerBpsnumberTaker fee in basis points: 2.5.
maxLeveragenumberHighest leverage an order can use: 20x.
escapeSlotsoptionalu64Slots without a batch before escape_withdraw opens. Default 1500.

Plain Markdown tables work too:

MarketQuote
SOL-PERPUSDC
BTC-PERPUSDC
ETH-PERPUSDC

Callouts

Cards

Diagram

<Diagram> draws a path of parts with what passes between them. It turns into a column on narrow screens.

Walletsigns once
authorizes
Session keysigns each order
orders over /ws
Enginematches, marks, funds
batch every 2 s
Programholds USDC
Kinds: wallet, client, engine, program, chain.

Data modules

A page can import from content/docs/_data/ and from @/lib/facts, so a figure is written once and every page that shows it agrees.