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

# Swap limits

> The largest amount a taker can swap, from the same arithmetic that prices a quote.

"Swap max" for a wallet: its balance, its Permit2 allowance, and the most it can sell once the fee and gas
lines are charged in the sell token. Ask before quoting so the taker never signs a fill their balance
cannot cover.

<ParamField query="chainId" type="number">Defaults to the primary EVM chain.</ParamField>

<ParamField query="taker" type="string" required />

<ParamField query="sellToken" type="string" required />

<ParamField query="buyToken" type="string" required />

<ResponseField name="chainId" type="number" />

<ResponseField name="sellToken" type="string" />

<ResponseField name="buyToken" type="string" />

<ResponseField name="balance" type="string">What the taker holds of `sellToken`.</ResponseField>
<ResponseField name="allowance" type="string">Approved to Permit2. Equals `balance` on Solana.</ResponseField>
<ResponseField name="max" type="string">The largest `sellAmount` the balance covers.</ResponseField>
<ResponseField name="takerPays" type="string">What `max` costs including fee lines charged in the sell token.</ResponseField>

<ResponseField name="feeBps" type="number" />

<ResponseField name="feeToken" type="string" />

<ResponseField name="gasFee" type="string">Today's gas fee in `gasFeeToken`.</ResponseField>

<ResponseField name="gasFeeToken" type="string" />

<ResponseField name="gasFeeUsd" type="number | null" />

<ResponseField name="minimum" type="string | null">The corridor's minimum sell amount.</ResponseField>

Errors: `400 wrong_chain`, `same_token`, `unsupported_token`, `unsupported_pair` (Solana), or a plain
message when a parameter is missing; `503 chain_unavailable` when the RPC did not answer.

<RequestExample>
  ```bash cURL theme={null}
  curl -s "https://relay-production-f175.up.railway.app/v1/limits?chainId=84532&taker=0xTaker&sellToken=0xe2387F04d3858e7Cb64Ef5Ed6617f9B2fcEEAfa2&buyToken=0x036CbD53842c5426634e7929541eC2318f3dCF7e"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "chainId": 84532,
    "sellToken": "0xe2387F04d3858e7Cb64Ef5Ed6617f9B2fcEEAfa2",
    "buyToken": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
    "balance": "50000000000000", "allowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
    "max": "50000000000000", "takerPays": "50000000000000",
    "feeBps": 5, "feeToken": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
    "gasFee": "100000", "gasFeeToken": "0x036CbD53842c5426634e7929541eC2318f3dCF7e", "gasFeeUsd": 0.1,
    "minimum": "1000000000"
  }
  ```
</ResponseExample>
