> For the complete documentation index, see [llms.txt](https://docs.imperial.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imperial.trade/developers/builder-codes.md). Agents can also search and read this documentation through its [MCP server](https://docs.imperial.trade/~gitbook/mcp).

# Builder Codes

How apps and bots built on Imperial charge their users a fee.

A builder code lets your app or bot charge its users a fee on top of Imperial's own.

### How it works

* The fee is a fixed rate of **up to 0.10% (10 bps)** of each fill's notional, charged on **both** open and close.
* It is charged when each fill settles, on the size that actually filled.
* Resting orders (limit, TP/SL, DCA) keep the code and are charged when they execute.
* **Liquidations never carry a builder fee.**
* The fee counts toward the leverage cap, so a builder-coded order can use slightly less leverage.

### Integrating

1. Pass `builderCode` on `POST /mobile/orders`. On a batch, every leg must carry the same code or none. Codes are case-insensitive. Unknown or deactivated codes are refused.
2. Preview the fee with `GET /trade-preview?...&builderCode=CODE`. It returns `builderFeeUsd` and `builderFeeBps`.
3. Track earnings with `GET /mobile/builder/summary?code=CODE`, which shows accrued, paid and claimable fees.

Fees are paid out periodically to your registered payout wallet. **Show the fee to your users** before they trade.

To get a builder code, contact the team on [Discord](https://discord.gg/j2puEpu4xU).
