Makers
The agents on the other side of every deal. What a maker is, how the reference makers price, and how to run one.
- Identity
- A NEAR account
- Signs with
- Its quote key
- Bonds
- Test USDC
What a maker is
A maker is an agent with a NEAR account, registered on the desk. It quotes the requests sealed to it, gives from its own private balance, and settles its leg of each deal it wins. Unlike traders, makers are public, like any market maker: the desk lists each one's name, pricing style, bond, deals and slashed amount. See them in Makers.
A maker holds four things:
- a NEAR account, which registers it and posts its bond,
- a Hushd seed, behind its private balance and its X25519 key (the key asks are sealed to),
- a quote key (ed25519), whose signature on a quote is its consent to those exact terms, and
- a bond in test USDC, which backs the hedge leg of the deals it wins.
The reference makers
Hushd runs three makers in services/src/makers.ts, so the desk always has someone to trade with. They are automated agents: each reads its asks, prices them by formula, signs, bonds and settles on its own, and acts on NEAR through its own policy wallet. No language model sets a price. They differ only in how they set the spread:
| Style | Spread |
|---|---|
fixed | 25 basis points on every quote |
volatility | 10 plus 0.6 times the last hour's realized volatility, in basis points, held between 15 and 150 |
inventory | 15 basis points when it holds plenty of what it gives, widening to 75 as that runs low |
Pricing
The reference makers price from Hyperliquid mid prices (public market data), with USDC at one dollar. They take a dry NEAR Intents (1Click) quote for the same trade as a second reference, and never quote better than that market less their spread. A maker you run can price from anything you like.
They quote only what they can fill from their own private balance, and each quote holds for five minutes. For a hedged package (experimental) they add the hedge: a short of the perp for the size they give, placed for their own Hyperliquid account, as an immediate-or-cancel order with a limit of 99% of the mid, a ten-minute deadline, and a bond of a tenth of the trade's value, rounded up to the desk's next bond step (min_bond, 1,000 USDC, times 1, 2, 5, 10, 20 and so on). They quote a hedged package only when their Hyperliquid testnet account holds the margin for it; none does yet, so no hedge has filled on testnet.
Quoting
The ask holds the package kind, the token and amount being sold, the token wanted and the hedge coin. It never holds the trader's limit or address. What the quote key (ed25519) signs is its consent to one exact deal on one desk:
"hushd.quote.v2"
‖ desk account id (u32 LE length ‖ utf8)
‖ rfq id (u64 LE)
‖ terms hash (32 bytes)
‖ bond (u128 LE)
‖ expires at, ms (u64 LE)
‖ class (u8: 0 atomic_pool, 1 bonded_hedge, 2 atomic_intents)
‖ hedge hash (32 bytes: sha256 of the borsh HedgeSpec, or zeros)
‖ maker account id (u32 LE length ‖ utf8)The desk rebuilds these bytes from the match itself and checks the signature against the key the maker registered before it records a deal, so a matcher cannot attach a class, a hedge or a maker the maker did not sign. In the protocol package the same bytes are consentBytes.
Settling the leg
The maker is always online, so it is the one that submits. It waits for the trader's plan, checks the note made for it opens to the agreed amount, makes its own two outputs and sends the trader the opening of the one meant for them, proves its leg, waits for the trader's proven leg, signs the four outputs with its quote key, and sends both legs and both signatures through the relayer to desk.settle. In the SDK this is one call, settleAsMaker. How the two legs are bound together is in how the desk works.
Since the maker submits, it has a last look: it holds the trader's proven leg until the deal expires and could settle only if the price still suits it. That costs it no bond on a spot deal, but each lapse is public, and requests skip a maker that let more than 25% of its last 20 ended deals lapse. The reference makers settle each deal they win as soon as both legs are ready. See last look.
Bonds
- Post: send test USDC to
desk.hushd.testnetwithft_transfer_calland the messagebond. Only a registered maker can post. - Lock: each hedged deal locks the bond its quote named. The desk refuses a match the free bond cannot cover, and a bond that is not one of its steps (
min_bondtimes 1, 2 or 5, or a power of ten times one of those;bondStepAtLeastin the SDK picks one). - Release or slash: a filled hedge releases it, and a missed one pays it to the trader as a private note. See bonds and slashing.
- Withdraw:
withdraw_bondreturns any part of the free bond.
Run one
- Create a NEAR testnet account for the maker and give it a little testnet NEAR.
- Make a 32-byte seed (its private wallet) and an ed25519 quote key (a 32-byte secret), both as hex, and keep both secret.
- For hedged packages, give it a Hyperliquid testnet account with margin. Its key approves each hedged deal's own address as an agent, so the hedge trades on the maker's margin and the position is the maker's.
- Start the makers service with them. On start, each maker registers itself on the desk with
register_maker(name, X25519 key, quote URL, style, quote key), or updates its keys. - Give it inventory: add test tokens to its private balance, or pay its hushd1… address.
- Post a bond if it should quote hedged packages: at least the desk's
min_bond(1,000 USDC).
In a checkout of the repo, put the maker's settings in the repo's .env. The services read that file themselves, and every variable is listed in .env.example.
MAKER_A_ACCOUNT=your-maker.testnet
MAKER_A_PRIVATE_KEY=ed25519:… # the account's key
MAKER_A_SEED=… # 32 bytes hex: the maker's private wallet
MAKER_A_QUOTE_KEY=… # its ed25519 quote key: the secret, 32 bytes hex
MAKER_A_HL_KEY=0x… # optional: its Hyperliquid testnet key, for hedged deals
MAKERS_PUBLIC_URL=https://makers.example.com
RELAYER_URL=https://api.hushd.net
API_URL=https://api.hushd.netMAKERS_PUBLIC_URL is where others reach this service: each maker registers <MAKERS_PUBLIC_URL>/makers/<account>/quote as its quote URL. The service runs up to three makers (MAKER_A, MAKER_B, MAKER_C) with the three styles above, and keeps their notes in an encrypted file. Then start it:
pnpm stack # the easy way: every service, behind one gateway
pnpm --filter @hushd/services start makers # or the makers alonepnpm stack runs every service whose keys are in .env behind one gateway on localhost:8080, routed like the production Caddyfile. deploy/docker-compose.yml runs the same services from the same .env file.
Selling quotes over x402
Each reference maker also sells indicative quotes at /makers/<account>/quote on the API, priced by X402_QUOTE_PRICE in USDC base units (10000, or 0.01 test USDC, by default) and paid by private x402 to the maker's own hushd1… address. A paid request returns what the maker would give for that size right now, valid for 30 seconds. Payments already used are kept on disk, so a restart cannot replay them.