Docs / trading

Agents & builder codes

How Hedgepit signs L1 actions without wallet popups, and what a builder code actually charges.

Two signing identities#

Hedgepit uses two separate signing identities for L1 actions:

  • Master wallet — your connected wallet (Rabby, MetaMask, etc). Used only for user-signed actions: approveAgent, approveBuilderFee, transfers, and EVM-side sends.
  • Local agent — a freshly-generated keypair stored in your browser, keyed by network + master address. Signs all routine L1 actions (orders, cancels, leverage changes) so trading doesn't trigger a wallet popup per action.

The agent keypair lives in localStorage; it never leaves your browser, and a new one is generated per master / network pair so testnet and mainnet stay separate.

Builder codes#

A builder code is an address attached to every order. Hyperliquid pays a fraction of the protocol fee to that address on close, burn, or settle events.

Hedgepit attaches its builder code to every order, without exception — the order builder throws MissingBuilderError if the address is unset, so there is no silent fallthrough.

What this means in practice:

  • Opens are zero fees. No builder-code revenue accrues on opens.
  • Closes and settles charge the per-order builder fee (capped at the ceiling you approved via approveBuilderFee).
  • The fee is paid in the pair's feeToken (often USDH for HIP-4), not always USDC.

The approval is one-time: you sign approveBuilderFee once at agent setup, and subsequent orders inherit it. The signed ceiling is the maximum per-order fee in tenth-bps; Hedgepit's actual per-order charge sits at or below that ceiling.

The workstation surfaces the builder fee alongside HL's native perp taker fee in a single "Fees + funding (est.)" row in the execution rail. The tooltip breaks down builder open / close, HL perp taker (open / close · tier), and a predicted funding estimate over the settlement window — see the workstation page for the full layout.