# Builder Codes

### Implementation Logic

Builder codes enable developers who build alternative frontends for Extended to earn a builder fee on each trade they route for users. This fee goes 100% to the builder and is defined per-order. To enable builder codes, a builder must have an Extended account.

When a builder routes an order through their app or strategy, they include their `clientId` (available on the API page in the Extended UI) and a `builderFee` value:

```
builderId: 123,     // builder's clientId
builderFee: 0.0005  // fee fraction (0.0005 = 0.05%)
```

The maximum allowed builder fee can be fetched using the `get_fees` method — the `TradingFeeModel` includes the `builder_fee_rate` parameter.

There is no manual builder-fee claiming process. All builder fees are automatically transferred to the builder’s Extended account daily at 00:00 UTC.

You can find an example implementation in our Builder Order Example Code: [link](https://github.com/x10xchange/python_sdk/tree/starknet/examples/cases).

If a user qualifies for a trading rebate while using a builder code, they still receive that rebate. The builder-codes system fully supports Extended’s fee and rebate schedules.

### Referrals & Builder Codes

If a user registers using a referral code, that code is permanently associated with the user’s account, regardless of whether the user trades via the UI or through a builder integration.

In addition, builders may issue their own referral or affiliate codes. Builders can encourage users to activate these codes in order to qualify for extended revenue sharing and referral points.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.extended.exchange/extended-resources/builder-codes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
