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

# Developer Accounts

> Build on Bison and earn from trading fees

## Overview

Developer accounts allow you to build applications on top of Bison and earn a portion of the trading fees generated by your users. Each dev account has its own fee structure and receives a share of the fees collected on trades.

## What is a Dev Account?

A dev account is an identifier that you can associate with orders placed through the Bison API. When an order with your dev account ID fills, you receive the majority of the fee from that trade.

## Fee Parameters

Fees are calculated based on the following parameters:

* **Fee Rate (bps):** The percentage fee rate applied to trades. For example, 100 bps = 1% of the trade amount. This determines the percentage-based fee collected from users.

* **Gross Base Fee (µUSDC):** The minimum fee charged per trade, regardless of size. The gross fee is the maximum of this base fee and the percentage-based fee.

* **Bison Cut (bps):** The percentage of the gross fee that goes to Bison.

<Note>
  Bison's fee cut is **33.33% (3,333 bps)**. The majority is passed on to you, the developer. If your application does significant trading volume,
  please reach out to the Bison team directly to discuss a different fee structure.
</Note>

## Using a Dev Account

### In the SDK

When creating a Bison client, pass your dev account ID to automatically apply it to all orders:

```typescript theme={null}
import { createBisonClient } from '@bison-markets/sdk';

const client = createBisonClient({
  baseUrl: 'https://api.bison.markets',
  devAccountId: 'your-dev-account-id'
});
```

All orders placed through this client will automatically include your dev account ID. The SDK handles this for you when calling `executeBuyFlow`, `executeSellFlow`, or `placeOrder`.

#### Client-Level Dev Account

Setting `devAccountId` at the client level is the recommended approach:

```typescript theme={null}
const client = createBisonClient({
  baseUrl: 'https://api.bison.markets',
  devAccountId: 'my-app-dev-account'
});

// This order automatically uses 'my-app-dev-account'
await client.executeBuyFlow({
  walletClient,
  publicClient,
  userAddress: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
  chain: 'base',
  marketId: 'KXFEDDECISION-26JAN-T425',
  side: 'yes',
  ccontracts: '1000', // 10.00 contracts * 100
  priceUusdc: '650000',
});
```

#### Per-Order Dev Account Override

You can override the client-level dev account for specific orders:

```typescript theme={null}
const client = createBisonClient({
  baseUrl: 'https://api.bison.markets',
  devAccountId: 'default-dev-account'
});

// Override with a different dev account for this specific order
await client.placeOrder({
  chain: 'base',
  marketId: 'KXFEDDECISION-26JAN-T425',
  ccontracts: '1000', // 10.00 contracts * 100
  priceUusdc: '650000',
  action: 'buy',
  side: 'yes',
  userAddress: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
  signature: '0x...',
  expiry: 1234567890,
  devAccountId: 'special-dev-account' // Overrides client default
});
```

#### No Dev Account

If you don't want to use a dev account, simply omit the `devAccountId` parameter:

```typescript theme={null}
const client = createBisonClient({
  baseUrl: 'https://api.bison.markets'
  // No devAccountId - orders will not be associated with a dev account
});
```

### In the API

When placing an order via the API, include the `devAccountId` field:

```json theme={null}
{
  "chain": "base",
  "marketId": "KXNBA-25NCHAM",
  "ccontracts": "10000",
  "priceUusdc": "750000",
  "action": "buy",
  "side": "yes",
  "userAddress": "0x...",
  "signature": "0x...",
  "expiry": 1234567890,
  "devAccountId": "your-dev-account-id"
}
```

## Getting a Dev Account

To set up a developer account and start earning from trading fees, please reach out to the Bison team at [team@bison.markets](mailto:team@bison.markets)

We'll work with you to:

1. Create your dev account with a custom fee structure
2. Provide you with your unique dev account ID
3. Help you integrate the account into your application

## Fee Settlement

Fees progress through three states as trades are confirmed and settled:

1. **Pending** - Fees from trades not yet confirmed
2. **Locked** - Fees being processed by the operator
3. **Unclaimed** - Fees ready to claim from the vault contract

### Checking Your Fee Balance

Use the SDK or API to check your accumulated fees:

```typescript theme={null}
const fees = await client.getDevAccountFees({
  devAccountId: 'your-dev-account-id'
});

console.log(`Claimable: ${fees.unclaimedFeesUusdc / 1_000_000} USDC`);
```

### Claiming Fees

When you have unclaimed fees, claim them directly to your signer address:

```typescript theme={null}
const txHash = await client.claimDevFees({
  walletClient,
  publicClient,
  devAccountId: 'your-dev-account-id',
});
```

See the [Developer Fees SDK documentation](/sdks/typescript/api/dev-fees) for complete examples and error handling.
