πŸ“—APIs

Requirement

The PiperX APIs provide a way to query PiperX standard (v2) and concentrated pools (v3) status. The below examples demonstrated how to query them. Note that PiperX API implemented CORS Policy. Therefore, if you want to use PiperX APIs from your deployed site (https://example.xyz), you need to contact PiperX team first to add your site.

DEX Stats

Get TVL and Volume of PiperX

Example query

curl https://piperxdb.piperxprotocol.workers.dev/api/piperxapi/tvl

Example output

{
  "dex": {
    "id": "piperx",
    "name": "PiperX",
    "totalVolumeUSD": "49432841143971", // decimal 6 for USD
    "totalVolumeNative": "15038256415533119426220899", // decimal 18 for native token
    "tvlUSD": "6979210444605",
    "tvlNative": "1034401251952740102208458"
  }
}

Recent Transactions

Recent swap transactions on a list of pools

Example query

Example output

Get All Tokens

Fetch all tokens and their price on PiperX V2 and V3 pool, including those tokens without transactions (price = 0)

Example query

Example output

Token Historical Prices

Fetch a list of tokens' historical price

Example query

Example output

Last updated