# Builder Code

All trades on Pear Protocol are routed through the Pear Protocol builder address:

```
0xA47D4d99191db54A4829cdf3de2417E527c3b042
```

Before making any trades, users must approve the Pear Protocol builder address to charge fees. This is a one-time approval per wallet done directly on Hyperliquid.

#### How It Works

Hyperliquid's builder fee system allows builders (like Pear Protocol) to charge a fee on each order routed through their address. Users must explicitly approve a maximum fee rate for each builder they interact with.

#### Approving the Builder Fee

Send an `approveBuilderFee` action to the Hyperliquid exchange endpoint. This requires an EIP-712 signature from the user's wallet.

Payload to sign:

```json
{
  "type": "approveBuilderFee",
  "hyperliquidChain": "Mainnet",
  "signatureChainId": "0xa4b1",
  "maxFeeRate": "0.01%",
  "builder": "0xA47D4d99191db54A4829cdf3de2417E527c3b042",
  "nonce": 1234567890
}
```

| Field              | Description                                              |
| ------------------ | -------------------------------------------------------- |
| `type`             | Must be `"approveBuilderFee"`                            |
| `hyperliquidChain` | `"Mainnet"` or `"Testnet"`                               |
| `signatureChainId` | `"0xa4b1"` (Arbitrum)                                    |
| `maxFeeRate`       | Maximum fee rate the builder can charge (e.g. `"0.01%"`) |
| `builder`          | Pear Protocol builder address                            |
| `nonce`            | Current timestamp in milliseconds                        |

#### Reference

See the Hyperliquid docs for full details on the exchange endpoint and builder fee approval: <https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#approve-a-builder-fee>


---

# 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.pearprotocol.io/api-integration/access-management/builder-code.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.
