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

# FAQ

> Frequently asked questions about integrating with the AKKA API

<AccordionGroup>
  <Accordion title="Why did my swap revert?">
    The most common reasons:

    1. **Slippage exceeded** — The price moved between quoting and execution. Increase your slippage tolerance or retry with a fresh swap call.
    2. **Stale transaction** — Too much time passed between getting the swap data and broadcasting. Re-fetch from `/swap` and try again.
    3. **Insufficient allowance** — The token wasn't approved, or the approval hasn't confirmed yet. Check with `/approve/allowance` before swapping.
    4. **Insufficient balance** — The wallet doesn't have enough tokens to cover the swap amount plus gas.

    In all revert cases, **no tokens are lost** — you only pay the gas fee for the failed transaction.
  </Accordion>

  <Accordion title="What is the native token address?">
    Use `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` to represent the chain's native token (HYPE on HyperEVM). This is a convention shared across most DEX aggregators.

    Native tokens don't need approval — skip the allowance check when swapping from HYPE.
  </Accordion>

  <Accordion title="How fresh are token prices?">
    Prices in the token endpoints (`buyPriceUsd`, `sellPriceUsd`) are refreshed every **\~5 seconds** from actual DEX pool reserves. For most use cases, polling every 15–30 seconds is sufficient.

    See the [Price API guide](/guides/price-api) for a polling pattern with local caching.
  </Accordion>

  <Accordion title="Do I need to approve tokens every time I swap?">
    No. The default approval sets an unlimited allowance for the AKKA Router contract. Once approved, you can swap that token as many times as you want without re-approving.

    Always call `/approve/allowance` first to check — if the allowance is already sufficient, skip the approval step.
  </Accordion>

  <Accordion title="What is the rate limit?">
    **20 requests per 60 seconds** per IP address. If you exceed this, the API returns HTTP 429.

    Tips to stay within limits:

    * Debounce user input (400ms+) before fetching quotes
    * Cache token lists — they don't change frequently
    * Use `GET /{chainId}/tokens` to fetch all tokens in one call instead of individual lookups
  </Accordion>

  <Accordion title="Which chains are supported?">
    Currently **HyperEVM (chain ID 999)** is the only supported chain. Ethereum, Arbitrum, and Base are coming soon.

    See [Supported Chains](/supported-chains) for details.
  </Accordion>

  <Accordion title="What's the difference between /quote and /swap?">
    * **`/quote`** returns the expected output amount and optional route/gas info. It's read-only — use it to display prices to the user.
    * **`/swap`** returns everything from `/quote` plus a ready-to-sign transaction object (`tx`). Use it when the user is ready to execute.

    Typical flow: show the user a quote as they type, then call `/swap` only when they click the swap button.
  </Accordion>

  <Accordion title="What does the from parameter do on /swap?">
    The `from` parameter is the wallet address that will execute the transaction. It's optional — if omitted, the API builds the transaction without a `from` field, and your wallet/library will fill it in when signing.

    Providing `from` allows the API to do balance and allowance pre-checks and return more accurate gas estimates.
  </Accordion>

  <Accordion title="Can I set a custom gas price?">
    Yes. The `/swap` endpoint accepts optional `gasPrice` and `gasLimit` parameters. If omitted, the API uses current network values.

    On HyperEVM, gas prices are low and stable — the API defaults are usually fine. Only override if you have a specific reason.
  </Accordion>

  <Accordion title="What is encodedTx in the swap response?">
    `encodedTx` is the full transaction tuple (from, to, data, value, gasPrice, gas) ABI-encoded as a hex string. It allows frontends to decode and execute the swap without needing the router contract ABI.

    Most integrations use the `tx` object directly — `encodedTx` is an alternative for advanced use cases.
  </Accordion>

  <Accordion title="How do I get an API key?">
    Contact the AKKA team on [Telegram](https://t.me/akka_finance) to request an API key. The key is passed as an `apikey` header on every request.
  </Accordion>

  <Accordion title="Can I use AKKA for limit orders or DCA?">
    The API provides instant swap execution, not scheduled orders. However, you can build limit orders or DCA on top of the API:

    * **Limit orders**: Poll `/quote` at intervals and execute `/swap` when the rate hits your target. See the [Node.js guide](/guides/node-backend) for a price monitoring example.
    * **DCA (Dollar Cost Averaging)**: Run a cron job or interval that executes a fixed swap at regular intervals.
  </Accordion>

  <Accordion title="What pool types does AKKA aggregate?">
    AKKA indexes liquidity from 20+ DEX pool types on HyperEVM, including Uniswap V2/V3 forks, Algebra, Curve, Balancer, and more. The pathfinder algorithm evaluates all pools to find the optimal route — including splitting across multiple pools when that gives a better rate.

    Use `/dex-compare` to see how the aggregated rate compares to individual DEX pools.
  </Accordion>
</AccordionGroup>
