> For the complete documentation index, see [llms.txt](https://docs.anchored.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anchored.finance/trading-api/market-data/on-chain-config.md).

# On-Chain Market Config

## Get market config

```
GET /api/v1/config
```

Returns on-chain exchange configuration for the current `chainId + productType` scope: cashier buffers, exchange fee settings, and per-token cashier limits/rates.

Permission: `READ_ONLY`. No query parameters.

This endpoint is separate from direct on-chain stock reference-price reads. For the `StockOracle` contract interface, see [Stock Oracle](/trading-api/market-data/stock-oracle.md).

## Response

Standard envelope. `data` contains:

| Field                | Type   | Description                                                    |
| -------------------- | ------ | -------------------------------------------------------------- |
| `cashierBuffer`      | object | Cashier-level buffer snapshot for instant deposit eligibility. |
| `exchangeFeeConfig`  | object | Exchange fee and minimum order settings.                       |
| `cashierTokenConfig` | object | Map of lowercase token address → per-token cashier config.     |

### Field naming note

`cashierBuffer` and each `cashierTokenConfig` entry use `chain`. `exchangeFeeConfig` uses `chainId`. Both represent the scoped chain ID.

### Value encoding

| Area                                                                 | Format                                | Example                                   |
| -------------------------------------------------------------------- | ------------------------------------- | ----------------------------------------- |
| `cashierBuffer.creditBuffer`, `creditBufferCapacity`, `totalBalance` | Raw WAD integer strings (18 decimals) | `"743810467000000000000"` ≈ 743.81 `mUSD` |
| `cashierTokenConfig.withdrawalBuffer`, `withdrawalBufferCapacity`    | Raw integer strings in token decimals | `"253689533"` with `decimals: 6`          |
| `exchangeFeeConfig.mintFeeRate`, `protocolFeeRate`, `minOrderValue`  | Human-readable decimal strings        | `"0"`, `"0.001"`                          |
| `cashierTokenConfig.depositRate`, `withdrawalRate`                   | Human-readable decimal strings        | `"1"`, `"0.9969"`                         |

Do not parse WAD or token-amount fields as human-readable decimals.

### `cashierBuffer`

| Field                     | Type   | Description                                                                                                                                                             |
| ------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `chain`                   | number | Chain ID for the scoped context.                                                                                                                                        |
| `productType`             | string | Product type, e.g. `Anchored`.                                                                                                                                          |
| `address`                 | string | Cashier contract address. Matches `cashierAddress` in `cashierTokenConfig` entries.                                                                                     |
| `instantThresholdDivisor` | string | Divisor used to cap instant operation size relative to buffer capacity. See [buffer mechanism — Instant Eligibility](/trading-api/cash-operations/buffer-mechanism.md). |
| `creditBuffer`            | string | Current `mUSD` credit buffer balance (WAD).                                                                                                                             |
| `creditBufferCapacity`    | string | Maximum `mUSD` credit buffer capacity (WAD).                                                                                                                            |
| `totalBalance`            | string | Total cashier balance snapshot (WAD).                                                                                                                                   |

Per-token `withdrawalBuffer` values live under `cashierTokenConfig`, not in this object.

### `exchangeFeeConfig`

| Field             | Type   | Description                                                                                               |
| ----------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| `chainId`         | number | Chain ID.                                                                                                 |
| `productType`     | string | Product type.                                                                                             |
| `mintFeeRate`     | string | Mint fee rate, human-readable (e.g. `0.001` = 0.1%). `"0"` means no mint fee.                             |
| `protocolFeeRate` | string | Protocol fee rate, human-readable. `"0"` means no protocol fee.                                           |
| `minOrderValue`   | string | Minimum order notional in USD, human-readable (e.g. `"1.00"`). `"0"` means no minimum enforced in config. |
| `txHash`          | string | Tx hash of the latest on-chain config update. May be empty when no update tx is recorded.                 |
| `updatedAt`       | number | Unix seconds when config was last updated.                                                                |

Use `minOrderValue`, `mintFeeRate`, and `protocolFeeRate` when validating or displaying order economics before calling order endpoints.

### `cashierTokenConfig` entries

Map keys are lowercase ERC-20 token addresses. Each value includes:

| Field                      | Type    | Description                                                             |
| -------------------------- | ------- | ----------------------------------------------------------------------- |
| `chain`                    | number  | Chain ID.                                                               |
| `productType`              | string  | Product type.                                                           |
| `cashierAddress`           | string  | Cashier contract address.                                               |
| `tokenAddress`             | string  | ERC-20 token address.                                                   |
| `minAmount`                | string  | Minimum deposit/withdraw amount in whole tokens.                        |
| `decimals`                 | number  | Token decimals.                                                         |
| `depositPaused`            | boolean | Deposit flow paused for this token.                                     |
| `withdrawPaused`           | boolean | Withdraw flow paused for this token.                                    |
| `depositRate`              | string  | Deposit rate, human-readable (e.g. `1` = no fee).                       |
| `withdrawalRate`           | string  | Withdrawal rate, human-readable (e.g. `0.9969`).                        |
| `withdrawalBuffer`         | string  | Current on-chain token buffer for instant withdrawals (token decimals). |
| `withdrawalBufferCapacity` | string  | Maximum token buffer capacity for instant withdrawals (token decimals). |

Check `depositPaused`, `withdrawPaused`, and buffer fields before building deposit or withdrawal calldata. See [cash deposits](/trading-api/cash-operations/deposits.md) and [withdrawals](/trading-api/cash-operations/withdrawals.md).

## Integration notes

* For instant vs queued cash behavior, pair buffer fields here with [buffer mechanism](/trading-api/cash-operations/buffer-mechanism.md).

Example payload: [sample-responses.md — Market config](/trading-api/reference/sample-responses.md).
