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

# Fees and credits

> 0.30% on settled trades, an optional integrator fee up to 1%, and the pull-payment ledger every amount passes through.

## The fee

`FEE_BPS = 30`, a constant with no setter. On `fulfill` the market takes `amount × 30 ÷ 10,000`, rounded down, from the escrowed token.

| Escrow | Fee | Filler receives |
| - | - | - |
| 50,000 DAI | 150 DAI | 49,850 DAI + bond |
| 2.5 WETH | 0.0075 WETH | 2.4925 WETH + bond |
| 12,000 USDC | 36 USDC | 11,964 USDC + bond |

Refunds, cancellations and bond returns are free. Every settlement emits `FeeTaken(id, token, fee)`, and the API totals them by day in `GET /stats`.

![The fee and what the filler receives, shown before posting](https://mintcdn.com/ambi/YFcg3UdfEoAyYkl8/images/app/swap-offer-light.webp?fit=max\&auto=format\&n=YFcg3UdfEoAyYkl8\&q=85\&s=4e6196dd8535121d09cb95785c1abfb2)

## Integrator fees

A wallet, aggregator or front end that lists orders can earn its own fee on them. It lists with `listVia(token, amount, bond, request, integrator, bps)`, naming the address paid and a rate from 1 to 100 basis points, so at most 1%.

* **Fixed at listing.** The terms are stored in `integrators(id)`, the maker signs them with the listing, and the order page shows them to every filler.
* **Paid only at release.** On `fulfill`, the integrator is credited `amount × bps ÷ 10,000`, rounded down, next to the protocol fee. Refunds, expiry and cancellations pay nothing.
* **Out of the filler's proceeds,** like the protocol fee, so fillers price it into their quotes.

| Escrow | Protocol 0.30% | Integrator 0.50% | Filler receives |
| - | - | - | - |
| 10,000 USDC | 30 USDC | 50 USDC | 9,920 USDC + bond |

`listVia` emits `IntegratorSet(id, integrator, bps)` and settlement emits `IntegratorFeeTaken(id, integrator, token, fee)`. Integrators withdraw from their credits like anyone else. Orders listed with `list` have no integrator fee.

## The fee recipient

Fees are credited to `feeRecipient`. The market owner can propose a new recipient, and the change happens only when that address accepts. Changing the recipient never touches fees already credited.

## Credits

Every amount that leaves an order (escrow, fee, bond) becomes a credit in `credits[owner][asset]`, where ETH is `address(0)`. Nothing is pushed during settlement, so a recipient that reverts can't block anyone else's settlement, and there is no external call for reentrancy.

## Withdraw

`withdraw(asset, to)` sends your whole credit for that asset to any address except zero and the market. The credit is cleared before the transfer, and the market checks both balances moved by exactly the amount.

![Credits waiting under Claim](https://mintcdn.com/ambi/YFcg3UdfEoAyYkl8/images/app/swap-claim-light.webp?fit=max\&auto=format\&n=YFcg3UdfEoAyYkl8\&q=85\&s=d2391ec2b44f928734924c21b1875b54)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.