# API

For contract interaction: <https://tfx-market.gitbook.io/tfx/transparency/contracts>

## **Tokens** <a href="#tokens" id="tokens"></a>

* URL: <https://api.tfx.market/tokens>​
* Retrieve a list of tokens and info for each token
* USD amounts are multiplied by (10 \*\* 30)
* Token amounts are multiplied by (10 \*\* token.decimals)

## **Prices** <a href="#prices" id="prices"></a>

The tokens endpoint will return the current prices in the contract, these prices are used for swaps, xLP minting / redeeming. For opening and closing positions, the realtime median prices are used, to get these values:

* URL: <https://api.tfx.market/prices>​
* Retrieve a list of token prices
* Prices are multiplied by (10 \*\* 30)

## **Actions** <a href="#actions" id="actions"></a>

* URL: <https://tfx.market/#/actions>​
* Retrieve a list of actions, these will include swaps, increasing a position, decreasing a position, orders and liquidations
* Params:
  * account (optional): pass in the checksum address of an account
  * after (optional): for pagination, the id to start after
* To get the checksum address: <https://web3-tools.netlify.app/>, you can also use a library like [ethers](https://docs.ethers.io/v5/)​

## **Analytics** <a href="#actions" id="actions"></a>

* URL: [https://stats.tfx.market](https://stats.tfx.market/)

## **Leaderboard** <a href="#actions" id="actions"></a>

* URL: <https://leaderboard.tfx.market/op-bnb-testnet/leaderboard>
