AKKA Finance
  • 🏠Getting Started
    • 🌟Why AKKA?
    • ❓What is AKKA?
  • AKKA API
    • 👷Introduction
    • 🌐Quick start
    • ⚙️Swagger
    • 3️⃣Use API endpoints of AKKA
    • ↗️Example
  • Smart Contracts
Powered by GitBook
On this page
  1. AKKA API

Swagger

PreviousQuick startNextUse API endpoints of AKKA

Last updated 5 months ago

You can also find AKKA API swagger directly here :

Using AKKA Swap API, you can find the best route to exchange assets and make the exchange.

Step by step:

  • Lookup addresses of tokens you want to swap, for example ‘0xxx’ , ‘0xxxx’ for ICE -> CORE

  • Check for allowance of AKKA router contract to spend source asset (/approve/allowance)

  • If necessary, give approval for AKKA router to spend source token (/approve/transaction)

  • Monitor the best exchange route using /pks-quote or /quote

  • When you are ready to perform the swap, use /swap

⚙️
Swagger UI

Find the best quote to exchange via AKKA router, with pks structure

get
Path parameters
chainIdnumberRequired
Query parameters
srcstringRequiredExample: 0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
dststringRequiredExample: 0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE
amountstringRequiredExample: 10000000000000000
Responses
200
PKS Quote
application/json
Responseobject
get
GET /{chainId}/pks-quote?src=text&dst=text&amount=text HTTP/1.1
Host: v2
Accept: */*
200

PKS Quote

{}

Find the best quote to exchange via AKKA router

get
Path parameters
chainIdnumberRequired
Query parameters
srcstringRequiredExample: 0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
dststringRequiredExample: 0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE
amountstringRequiredExample: 10000000000000000
includeTokensInfobooleanOptional

Return fromToken and toToken info in response

includeProtocolsbooleanOptional

Return swap protocols in response

Responses
200
Quote
application/json
400
One of the following errors:
  • Insufficient liquidity
  • Cannot estimate
  • You may not have enough ETH balance for gas fee
  • FromTokenAddress cannot be equals to toTokenAddress
  • Cannot estimate. Don't forget about miner fee. Try to leave the buffer of ETH for gas
  • Not enough balance
  • Not enough allowance
application/json
get
GET /{chainId}/quote?src=text&dst=text&amount=text HTTP/1.1
Host: v2
Accept: */*
{
  "toAmount": "text",
  "toToken": {
    "symbol": "text",
    "name": "text",
    "decimals": 1,
    "address": "text",
    "logoURI": "text",
    "tags": [
      "text"
    ]
  },
  "fromToken": {
    "symbol": "text",
    "name": "text",
    "decimals": 1,
    "address": "text",
    "logoURI": "text",
    "tags": [
      "text"
    ]
  },
  "protocols": [
    [
      [
        {
          "name": "string",
          "part": "number",
          "fromTokenAddress": "string",
          "toTokenAddress": "string"
        }
      ]
    ]
  ]
}

Generate data for calling the AKKA router for exchange

get
Path parameters
chainIdnumberRequired
Query parameters
srcstringRequiredExample: 0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
dststringRequiredExample: 0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE
amountstringRequiredExample: 10000000000000000
fromstringRequired

The address that calls the AKKA contract

slippagenumberRequired

min: 0; max: 50;

Example: 1
includeTokensInfobooleanOptional
includeProtocolsbooleanOptional
Responses
200
Swap
application/json
400
One of the following errors:
  • Insufficient liquidity
  • Cannot estimate
  • You may not have enough ETH balance for gas fee
  • FromTokenAddress cannot be equal to toTokenAddress
  • Cannot estimate. Don't forget about miner fee. Try to leave the buffer of ETH for gas
  • Not enough balance
  • Not enough allowance
application/json
get
GET /{chainId}/swap?src=text&dst=text&amount=text&from=text&slippage=1 HTTP/1.1
Host: v2
Accept: */*
{
  "toAmount": "text",
  "toToken": {
    "symbol": "text",
    "name": "text",
    "decimals": 1,
    "address": "text",
    "logoURI": "text",
    "tags": [
      "text"
    ]
  },
  "fromToken": {
    "symbol": "text",
    "name": "text",
    "decimals": 1,
    "address": "text",
    "logoURI": "text",
    "tags": [
      "text"
    ]
  },
  "protocols": [
    [
      [
        {
          "name": "string",
          "part": "number",
          "fromTokenAddress": "string",
          "toTokenAddress": "string"
        }
      ]
    ]
  ],
  "tx": {
    "from": "text",
    "to": "text",
    "data": "text",
    "value": "text",
    "gasPrice": "text",
    "gas": 1
  }
}

Address of the AKKA router that must be trusted to spend funds for the exchange

get
Path parameters
chainIdnumberRequired
Responses
200
Address of the AKKA router that must be trusted to spend funds for the exchange
application/json
get
GET /{chainId}/approve/spender HTTP/1.1
Host: v2
Accept: */*
200

Address of the AKKA router that must be trusted to spend funds for the exchange

{
  "address": "text"
}

Generate data for calling the contract in order to allow the AKKA router to spend funds

get
Path parameters
chainIdnumberRequired
Query parameters
tokenAddressstringRequired

Token address you want to exchange

Example: 0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
amountstringOptional

The number of tokens that the AKKA router is allowed to spend. If not specified, it will be allowed to spend an infinite amount of tokens.

Example: 100000000000
Responses
200
Transaction body to allow the exchange with the AKKA router
application/json
get
GET /{chainId}/approve/transaction?tokenAddress=text HTTP/1.1
Host: v2
Accept: */*
200

Transaction body to allow the exchange with the AKKA router

{
  "data": "text",
  "gasPrice": "text",
  "to": "text",
  "value": "text"
}

Get the number of tokens that the AKKA router is allowed to spend

get
Path parameters
chainIdnumberRequired
Query parameters
tokenAddressstringRequired

Token address you want to exchange

Example: 0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
walletAddressstringRequired

Wallet address for which you want to check

Responses
200Success
application/json
get
GET /{chainId}/approve/allowance?tokenAddress=text&walletAddress=text HTTP/1.1
Host: v2
Accept: */*
200Success
{
  "allowance": "text"
}

List of tokens that are available for swap in the AKKA Aggregation protocol

get
Path parameters
chainIdnumberRequired
Query parameters
pagenumberOptionalDefault: 0
limitnumberOptionalDefault: 1000
Responses
200
All supported tokens (can also use your own)
application/json
get
GET /{chainId}/tokens HTTP/1.1
Host: v2
Accept: */*
200

All supported tokens (can also use your own)

{
  "tokens": {
    "token_address": {
      "symbol": "string",
      "name": "string",
      "decimals": 0,
      "address": "string",
      "logoURI": "string",
      "tags": [
        "string"
      ]
    }
  }
}

Data of a single token

get
Path parameters
chainIdnumberRequired
addressstringRequiredExample: 0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
Responses
200
Information about the requested token address
application/json
get
GET /{chainId}/tokens/{address} HTTP/1.1
Host: v2
Accept: */*
200

Information about the requested token address

{
  "symbol": "text",
  "name": "text",
  "decimals": 1,
  "address": "text",
  "logoURI": "text",
  "tags": [
    "text"
  ]
}
  • GETFind the best quote to exchange via AKKA router, with pks structure
  • GETFind the best quote to exchange via AKKA router
  • GETGenerate data for calling the AKKA router for exchange
  • GETAddress of the AKKA router that must be trusted to spend funds for the exchange
  • GETGenerate data for calling the contract in order to allow the AKKA router to spend funds
  • GETGet the number of tokens that the AKKA router is allowed to spend
  • GETList of tokens that are available for swap in the AKKA Aggregation protocol
  • GETData of a single token
Logo