> For the complete documentation index, see [llms.txt](https://txnlab.gitbook.io/haystack-dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://txnlab.gitbook.io/haystack-dev/haystack-api/fees.md).

# Fee Schedule

Haystack's swap fee schedule - base fees by trade size and discounts for holding HAY.

`GET https://api.hay.app/api/fees/config`

The swap fee schedule that [hay.app](https://hay.app) and the Haystack mobile app charge, as data. An excerpt (read the current values from the API, they change):

```json
{
  "hayAssetId": 3160000000,
  "baseFeeTiers": [{ "minUsdAmount": 0, "feeBps": 100 }, { "minUsdAmount": 25, "feeBps": 85 }, ...],
  "discountTiers": [{ "minUsdAmount": 0, "discount": 0 }, { "minUsdAmount": 10, "discount": 10 }, ...]
}
```

* `baseFeeTiers`: the fee in basis points by trade size, smallest trades first. A trade's size is the USD value of its input; an input with no USD price counts as $0. The last tier whose `minUsdAmount` the trade reaches applies.
* `discountTiers`: the discount, in percent of the base fee, for holding HAY. It is measured on the USD value of the HAY the account holds, liquid and staked together. The last tier whose `minUsdAmount` the holding reaches applies.

A trade's fee is the base fee less the discount, rounded half up, in integer arithmetic:

```
feeBps = (baseFeeBps × (100 − discount) + 50) / 100
```

So 85 bps with a 10% discount (76.5) is 77 bps. The apps pass the result to the router as its [`feeBps`](/haystack-dev/haystack-router/api-order-router.md#query-parameters). Your own integration sets its own `feeBps`.

The response carries `Cache-Control: max-age=300` and an `ETag`. The schedule rarely changes, so fetch it at startup and revalidate occasionally. Limited to 60 requests per minute.
