> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ostium.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Builder Set Up

> Set up an Ostium builder integration, configure builder fees, and choose the right client mode for your application.

This page is the starting point for builder integrations.

Builders typically care about two things first:

* how to attach builder fees to trades
* which client mode matches the way their product handles signing and submission

## Builder fees

Builder fees are configured once at client creation and then applied automatically to opening trades sent through that client.

* `builder.address` is where your fee share is routed
* `builder.feeBps` is the fee amount in basis points
* the allowed range is `0` to `50` bps
* builder fees apply on open, not on close

```ts theme={null}
const client = await OstiumClient.createSelfAndSelf({
  traderPrivateKey: userPrivateKey,
  rpcUrl: process.env.ARB_RPC_URL!,
  builder: {
    address: '0xYourBuilderAddress',
    feeBps: 20,
  },
});
```

If you do not want to charge builder fees, omit the `builder` config entirely.

You can also override builder settings on a single `openTrade()` call:

```ts theme={null}
await client.openTrade({
  pairId: 0,
  buy: true,
  price: '65000',
  collateral: '100',
  leverage: '10',
  type: OrderType.Market,
  builder: {
    address: '0xYourBuilderAddress',
    feeBps: 10,
  },
});
```

For builder-routed order history, use [getBuilderOrders](/developer/reference/get-builder-orders). It includes sibling close, TP, and SL orders on positions opened through the builder.

## Which client mode to use

### Wallet-driven frontend

Use `self-self` when the user signs and pays gas in their own wallet.

Use `self-gasless` when the user should still own the account but you want gasless trading after one-time setup.

This is usually the right fit for:

* React apps
* embedded trading widgets
* client-side wallet integrations

### Backend execution on behalf of users

Use `delegated-self` when your backend should sign and submit using a delegate EOA that pays gas.

Use `delegated-gasless` when your backend should sign but submit through a Safe user operation.

This is usually the right fit for:

* managed execution products
* server-side order routing
* apps that want users to keep custody while your backend handles execution

### Read-only market data

Use `createReadOnly()` when you only need prices, pairs, positions, candles, or order history in your app and you do not need transaction building or submission.

## Recommended path

* Start with [SDK Overview](/developer/sdk/overview) for the current API surface.
* Use [Client Modes](/developer/client-modes/overview) to choose the right mode for your integration.
* Use [Getting keys from the App](/developer/builders/getting-keys-from-the-app) if you want users to export a delegated gasless SDK account from `app.ostium.com/sdk-export`.
* Use [React Example](/developer/builders/react-quickstart) if your app needs wallet-driven transaction building and live position updates.

## Legacy note

If you are maintaining an older Python integration, the old docs are preserved under [Legacy](/developer/legacy/overview), but new integrations should use the current TypeScript SDK.
