> For the complete documentation index, see [llms.txt](https://titan-exchange.gitbook.io/titan/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://titan-exchange.gitbook.io/titan/developer-doc/special-order-types/guides/platform-fees.md).

# Platform Fees

Collect a platform fee on every execution — DCA cycles and trigger fills alike.

Titan can take a platform fee on each execution's swap output and send it to a wallet you control. That covers every order type — a DCA cycle, a trigger fill and each slice of a Slice Order are charged the same way. Fees run through Titan's native swap fee mechanism, so they're collected at execution time, not billed separately.

## How it's configured

The defaults and ceilings live on your tenant, set during onboarding:

| Setting               | Where it lives                      | Notes                                                                                                                  |
| --------------------- | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| Fee collection wallet | Tenant config (set at onboarding)   | The Solana address that **receives** your fees. Provide one to collect fees; omit it to run fee-free.                  |
| `platformFeeBps`      | Tenant config                       | Your default fee in basis points (`10` = 0.1%).                                                                        |
| `maxFeeBps`           | Tenant config                       | Hard ceiling on per-order overrides.                                                                                   |
| `platformFee.bps`     | Per-order, on `POST /orders/intent` | Overrides the default for one order, whatever its type. Must be `0 ≤ bps ≤ maxFeeBps`. Omit to use the tenant default. |

{% hint style="warning" %}
With no fee wallet configured, fees are **disabled** for your tenant — nothing is taken regardless of `bps`. The wallet is set once at onboarding and isn't changeable via the API; changing it later is an operational request to Titan.
{% endhint %}

The fee wallet must accept arbitrary SPL tokens, because the fee mint varies per execution (see below) and this wallet accumulates whatever each swap produces across multiple mints. Use a standard self-custodial Solana wallet, not a single-token deposit address.

## Which mint the fee is taken in

Selection is deterministic and per-execution, checked in order:

1. If the **output** mint is a liquid mint (USDC, USDT, or WSOL), the fee is taken in the output mint.
2. Otherwise, if the **input** mint is liquid, the fee is taken in the input mint.
3. Otherwise, the fee is taken in the output mint.

So a `USDC → USDT` swap takes the fee in USDT (output wins). A `BONK → USDC` swap takes it in USDC (output is liquid). A `BONK → WIF` swap falls through to rule 3 and takes it in WIF.

## Per-order override

Pass `platformFee.bps` on `POST /orders/intent` to override your tenant default for a single order — including `0` to waive the fee on that order, subject to your contract:

```typescript
await callTitanDca('/orders/intent', {
  method: 'POST', sub,
  body: {
    orderType: 'dca',        // works the same on stop_loss | take_profit | oco | slice
    userPubkey,
    platformFee: { bps: 25 }, // 0.25% on this order; must be ≤ maxFeeBps
    config: { /* … */ },
  },
});
```

A `bps` above your `maxFeeBps` returns `400 VALIDATION_ERROR` with `details.maxAllowed` echoing the ceiling.

## Reconciling what was charged

Every execution stores a fee snapshot — one row per DCA cycle, one row per trigger fill, one row per slice. Read it per order via `GET /orders/{orderId}/executions`, or across your whole tenant for billing via `GET /partners/me/executions`:

```json
{
  "platformFeeWallet": "FeEa…",
  "platformFeeBps": 50,
  "platformFeeMint": "EPjFW…",
  "platformFeeAmount": "25000"
}
```

All four `platformFee*` fields populate together when a fee was charged. They're all `null` when no fee was taken — either the order's effective `bps` was `0`, or your tenant has no fee wallet configured.

## Related pages

* [Creating Orders](/titan/developer-doc/special-order-types/guides/creating-orders.md) — where `platformFee.bps` is set
* [Order & Execution Schema](/titan/developer-doc/special-order-types/reference/schema.md) — the full execution row, including the fee snapshot
* [Endpoints → Partner reporting](/titan/developer-doc/special-order-types/reference/endpoints.md#partner-reporting) — tenant-wide execution rows for billing
