# Builder codes

Source: https://docs.testnet.mog.xyz/integrators/builder-codes/

Markdown: https://docs.testnet.mog.xyz/integrators/builder-codes.md

Reviewed protocol version: 11.0.0

Protocol review date: 2026-10-30

Scope: reviewed public documentation. Numerical examples use illustrative or launch settings; they are not live quotes or a guarantee of current deployed parameters. Consult the app for current market and position values.

A builder code is an address. Any address can be one: there is no registration and no approval. An order names its builder when it is signed. The builder earns a share of the settlement fee each time that position settles a win.

## What a builder earns

When a winning position settles, Mog charges the [profit fee](https://docs.testnet.mog.xyz/trading/fees/#the-profit-fee). 70% of that fee goes to MOG buybacks and 30% to protocol operations. The protocol fixes this split; governance cannot change it. A builder takes its share out of the operations part only:

|                                                  | Launch value                    |
| ------------------------------------------------ | ------------------------------- |
| Builder share of the operations part             | 50%                             |
| The same share as a part of the whole profit fee | 15%                             |
| Buyback part                                     | 70%, never reduced by a builder |

The share is fixed for each position when it fills. A later governance change applies only to positions that fill after it. A losing close pays no profit fee, so it pays no builder. The open fee never goes to a builder.

## The holding rule

A builder must hold MOG to earn, and must prove it held it.

1. Hold at least the required MOG in the builder address. The launch requirement is 10,000 MOG.
2. Record the balance on chain: `mog builder attest`, or **Activate rewards** on the app's Referrals page. This stores the address's MOG balance and block. It does not move or lock any MOG.
3. At each settlement, the builder's balance and its recorded balance must both meet the requirement.

A record counts for settlement rounds that open in the same block as the record or later. Settlements in a round that opened in an earlier block do not pay you. Governance can also set a minimum age for the record, in blocks; it is zero at launch.

A settlement that fails the check pays the builder nothing, and the share stays with operations. Nothing is paid later for a failed settlement.

If your balance falls below the requirement, earnings stop until it recovers. When your recorded balance still meets the requirement, restoring the balance is enough: **do not record again**. A new record replaces the old one and does not count for a round that opened in an earlier block, so it can cost you the rest of the current round. Record again only when the recorded balance itself is below the requirement.

## Orders that cannot name you

The venue refuses an order at placement when its builder is the account itself, the key that signed it, or any live session key of the account. The order is never placed, so nothing is charged. Through the relay the refusal is `INTENT_WOULD_FAIL`. A builder code pays for routed orders, not a discount on your own trades.

## Collect your earnings

Earnings collect in a builder balance. They are paid as cash into the builder address's trading balance on Mog, from where the address can withdraw.

- **Pay:** anyone can trigger the payment for any builder: `mog keeper pay-builder`, or **Collect rewards** in the app. The money always goes to the builder. Payment waits while the venue is paused, and runs only when every market is at rest.
- **Order of payment:** builder payments are junior. They pay only from treasury cash above every trader claim, including claims used as collateral, so a payment can be partial, and a builder balance can wait.
- **Give up:** a builder can give up any part of its own unpaid balance with `mog builder renounce`. This is final, and it mints no MOG.

`mog builder status` shows the recorded balance, the requirement, and the earned, paid and unpaid amounts.

## Track builders

Every builder payment and every share booked to a builder is a public on-chain event. A builder leaderboard comes from these events. See [API](https://docs.testnet.mog.xyz/api/) for the read endpoints.
