API

In this section you will find everything necessary to make correct API calls

You can directly know the TVL, Total CHR Supply, Circulating Supply or the Pools APR direcly on our Endpoints.

Using Subgraph allows users to fetch relevant data of the protocol like: Daily Pair Data, Daily Tokens Data, Pool factory Data, Pool List, Swaps list & User Swaps although its possible to fetch any data you need.

"Daily Pair Data" query returns:

{
  "data": {
    "pairDayDatas": [
      {
        "date": 1682553600, // Date in Timestamp (27th April)
        "reserve1": "1358581.941223", // Total liquidity in USDC
        "reserve0": "789846.452525962689828775", //Total liquidity in CHR
        "token1": {
          "symbol": "USDC"
        },
        "token0": {
          "symbol": "CHR"
        },
        "dailyVolumeToken0": "3065199.472078795661522056", // Volume in USDC in 24 hours
        "dailyVolumeToken1": "3640765.689241", // Volume in CHR in 24 hours
        "dailyTxns": "1948", // Transaction count
        "pairAddress": "0x20585bfbc272a9d58ad17582bcda9a5a57271d6a"
      },
      { ... }, // 28th April
      ... // 29th April...
    ]
  }

"Pool List" query returns total data available:

{
  "data": {
    "pairs": [
      {
        "id": "0x0176416bdc885b1bb751b0a014d495760a972a73", // Pool Contract ID
        "token0": {
          "symbol": "fUSDC"
        },
        "token1": {
          "symbol": "WETH"
        },
        "txCount": "414", // Transaction Count
        "token0Price": "1882.606598725145944223884706209285", // Price relative to WETH
        "token1Price": "0.0005311784207476883189674052355843278", // Price relative to fUSDC
        "volumeToken0": "213834.692817", // Volume of fUSDC (fUSDC units)
        "volumeToken1": "110.922833414411321994", // Volume of WETH (WETH units)
        "reserve0": "1641073.765156", // Token liquidity of fUSDC deposited
        "reserve1": "871.702970906026818291", // Token liquidity of WETH deposited
        "totalSupply": "0.037718927837672981", // Total supply of LP tokens
        "isStable": false 
      },
      { ... },
      ...
    ]
  }
}

"Daily Tokens Data" query returns total data available:

 {
        "dailyTxns": "2565", // Daily Transaction Count
        "dailyVolumeToken": "804264.169122955107886158", // Daily Volume in Token
        "date": 1683417600, // Date in Timestamt
        "token": {
          "symbol": "CHR",
          "id": "0x15b2fb8f08e4ac1ce019eadae02ee92aedf06851" // Contract Address
        },
        "totalLiquidityToken": "2308222.805438528889660418" 
      },
      { ... },
      ...
    ]
  }
}

"Pool factory Data" query returns total data available:

{
  "data": {
    "factories": [
      {
        "pairCount": 127, // Total Pairs created 
        "txCount": "63567", // Transaction Count
        "id": "0xCe9240869391928253Ed9cc9Bcb8cb98CB5B0722" // Pool factory Address
      }
    ]
  }
}

"Swaps list" query returns total data available: //

{
  "data": {
    "swaps": [
      {
        "amount0In": "0", // Amount in from CHR
        "amount0Out": "63.94138175623618856", // Amount received of CHR
        "amount1In": "95.166363", // Amount deducted of USDC 
        "amount1Out": "0", / Amount out of USDC
        "timestamp": "1683174438", // Date in Timestamp
        "pair": {
          "isStable": false,
          "token0": {
            "symbol": "CHR"
          },
          "token1": {
            "symbol": "USDC"
        },
        "from": "0x40ee2afbfbc4286b25e2a194920c7d9591eef9dc",
        "transaction": {
          "id": "0x0001d2de097d34a38d0d12c0e4815438e1f29a4e7316472459d80d9ae9dabad7"
        }
      },

"User Swaps" query returns total data available:


{
  "data": {
    "swaps": [
      {
        "timestamp": "1682983903", // Date in Timestamt
        "pair": {
          "token0": {
            "symbol": "WETH"
          },
          "token1": {
            "symbol": "USDC"
          },
          "isStable": false,
        },
        "amount0In": "0",
        "amount0Out": "0.00545380057918301", // User receives in WETH
        "amount1In": "10", // User gets deduced in USDC
        "amount1Out": "0",
        "transaction": {
          "id": "0x06fef5847aa1f58daab64c775b3626204c6e6709c2108b45f0ca460ed3a00269"
        }
      },

Last updated