# AMM API Docs

The Arkadiko AMM has a public API that can be used for integrations. This page shows documentation on the endpoints and how they can be used

## /api/v1/tickers

{% embed url="<https://arkadiko-api.herokuapp.com/api/v1/tickers>" %}

The `/api/v1/tickers` API endpoint shows all trading pairs that are listed on the Arkadiko AMM. The endpoint returns a JSON with the following fields

| Name               | Data Type | Description                                                                                                                                                                         |
| ------------------ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ticker\_id         | string    | <p>Identifier of a ticker with delimiter to separate base/target, eg. BTC\_ETH</p><p>(Contract address for DEX)</p>                                                                 |
| base\_currency     | string    | Symbol/Currency code/Contract Address of a the base cryptoasset, eg. BTC (Contract address for DEX)                                                                                 |
| target\_currency   | string    | Symbol/Currency code/Contract Address of the target cryptoasset, eg. ETH (Contract address for DEX)                                                                                 |
| pool\_id           | string    | pool/ pair address or unique ID (Mandatory for DEX)                                                                                                                                 |
| last\_price        | decimal   | <p>Last transacted price of base currency based on given target currency (unit in base or target)<br><br></p><p>eg.</p><p>X = ?</p><p>1 base = X target</p><p>X base = 1 target</p> |
| base\_volume       | decimal   | 24 hour trading volume for the pair (unit in base)                                                                                                                                  |
| target\_volume     | decimal   | 24 hour trading volume for the pair (unit in target)                                                                                                                                |
| pool\_id           | string    | pool/pair address or unique ID (Mandatory for DEX)                                                                                                                                  |
| liquidity\_in\_usd | decimal   | Pool liquidity in USD                                                                                                                                                               |
| bid                | decimal   | Current highest bid price                                                                                                                                                           |
| ask                | decimal   | Current lowest ask price                                                                                                                                                            |
| high               | decimal   | Rolling 24-hours highest transaction price                                                                                                                                          |
| low                | decimal   | Rolling 24-hours lowest transaction price                                                                                                                                           |

## /api/v1/pools/:id

{% embed url="<https://arkadiko-api.herokuapp.com/api/v1/pools/2>" %}

Given a pool ID (e.g. 1, 2,3 etc), returns information about the pool and its assets. The endpoint returns a JSON with the following fields:

| Name              | Data Type | Description                                                 |
| ----------------- | --------- | ----------------------------------------------------------- |
| id                | string    | The ID of the entry in the DB                               |
| token\_x\_name    | string    | The name of token X in the pair                             |
| token\_y\_name    | integer   |                                                             |
| token\_x\_address | string    | Start time from which to query historical trades from       |
| token\_y\_address | string    | End time for historical trades query                        |
| token\_x\_id      | string    | The ID of token X of the entry in the DB                    |
| token\_y\_id      | string    | The ID of token Y of the entry in the DB                    |
| balance\_x        | string    | The balance of token X in the pool (denominated in token X) |
| balance\_y        | string    | The balance of token Y in the pool (denominated in token Y) |
| enabled           | boolean   | Whether pair is enabled in the AMM or not                   |

## /api/v1/pools/:id/prices

{% embed url="<https://arkadiko-api.herokuapp.com/api/v1/pools/2/prices>" %}

Given a pool ID (e.g. 1, 2, 3 etc), returns all historical prices of a pair.
