Skip to main content

Documentation Index

Fetch the complete documentation index at: https://akkafinance-4d5a30d3.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through a complete token swap on HyperEVM (chain ID 999) — from checking allowance to executing the swap.

Prerequisites

  • An API key (get one on Telegram)
  • A wallet with tokens on HyperEVM
  • Tokens to swap (this example swaps HYPE for UBTC)
1

Check allowance

Before swapping an ERC-20 token, check if the AKKA Router is allowed to spend it. For native token swaps (HYPE), skip to step 3.
curl -H "apikey: YOUR_API_KEY" \
  "https://api.akka.finance/swap/v1/999/approve/allowance?tokenAddress=0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb&walletAddress=YOUR_WALLET_ADDRESS"
Response:
{ "allowance": "0" }
If allowance is 0 or less than your swap amount, proceed to step 2. Otherwise, skip to step 3.
2

Approve token spending

Generate and submit an approval transaction so the AKKA Router can spend your tokens.
curl -H "apikey: YOUR_API_KEY" \
  "https://api.akka.finance/swap/v1/999/approve/transaction?tokenAddress=0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb"
Response:
{
  "data": "0x095ea7b3...",
  "gasPrice": "100000000",
  "to": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
  "value": "0"
}
Submit this transaction to the blockchain and wait for it to be confirmed before proceeding.
3

Get a quote

Check the expected output amount before executing the swap.
curl -H "apikey: YOUR_API_KEY" \
  "https://api.akka.finance/swap/v1/999/quote?src=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&dst=0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb&amount=1000000000000000000&includeTokensInfo=true"
Response:
{
  "dstAmount": "205340622987446484992",
  "srcToken": {
    "address": "0x5555555555555555555555555555555555555555",
    "symbol": "WHYPE",
    "name": "Wrapped HYPE",
    "decimals": 18,
    "logoUri": null
  },
  "dstToken": {
    "address": "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
    "symbol": "UBTC",
    "name": "Universal BTC",
    "decimals": 18,
    "logoUri": null
  }
}
4

Execute the swap

Generate the swap transaction data and submit it to the blockchain.
curl -H "apikey: YOUR_API_KEY" \
  "https://api.akka.finance/swap/v1/999/swap?src=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee&dst=0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb&amount=1000000000000000000&from=YOUR_WALLET_ADDRESS&slippage=1"
Response:
{
  "dstAmount": "12723902882990271",
  "tx": {
    "from": "0xYOUR_WALLET_ADDRESS",
    "to": "0xcce7452db4392b40aa0e1592a7c486e13bf69654",
    "data": "0x...",
    "value": "1000000000000000000",
    "gasPrice": "1000000000",
    "gas": "231973"
  },
  "encodedTx": "0x..."
}
5

Sign and broadcast

Submit the transaction object from step 4 to the blockchain.
JavaScript (viem)
const { tx } = swap;

const hash = await walletClient.sendTransaction({
  to: tx.to,
  data: tx.data,
  value: BigInt(tx.value),
  gasPrice: BigInt(tx.gasPrice),
  gas: BigInt(tx.gas),
});

const receipt = await publicClient.waitForTransactionReceipt({ hash });
console.log('Swap confirmed:', receipt.transactionHash);
The tx object is ready to use directly — no ABI encoding required. Just pass it to your wallet’s sendTransaction method.

Next steps

Full Working Example

Complete TypeScript implementation you can copy and run.

API Reference

Explore all endpoints with the interactive playground.