API References

GET /v1/chains

Get list of supported chains and supported protocols for each chain

Units Cost: 0

Response

[
    {
        "name": "Ethereum",
        "id": 1,
        "logo": "https://files.krystal.app/DesignAssets/chains/ethereum.png",
        "explorer": "https://etherscan.io",
        "supportedProtocols": [
            "sushiv3",
            "pancakev3",
            "uniswapv4",
            "uniswapv2",
            "sushiv2",
            "pancakev2",
            "uniswapv3"
        ]
    },
    {
        "name": "Binance Smart Chain",
        "id": 56,
        "logo": "https://files.krystal.app/DesignAssets/chains/bsc.png",
        "explorer": "https://bscscan.com",
        "supportedProtocols": [
            "pancakev2",
            "uniswapv2",
            "sushiv3",
            "uniswapv4",
            "sushiv2",
            "pancakev3",
            "uniswapv3",
            "pancakev4",
            "thena"
        ]
    },
    {
        "name": "Avalanche",
        "id": 43114,
        "logo": "https://files.krystal.app/DesignAssets/chains/avalanche.png",
        "explorer": "https://snowtrace.io",
        "supportedProtocols": [
            "uniswapv2",
            "uniswapv3",
            "uniswapv4"
        ]
    },
    {
        "name": "UniChain",
        "id": 130,
        "logo": "https://files.krystal.app/DesignAssets/chains/unichain.png",
        "explorer": "https://uniscan.xyz/",
        "supportedProtocols": [
            "uniswapv4",
            "uniswapv2",
            "uniswapv3"
        ]
    },
    {
        "name": "Polygon",
        "id": 137,
        "logo": "https://files.krystal.app/DesignAssets/chains/polygon.png",
        "explorer": "https://polygonscan.com",
        "supportedProtocols": [
            "sushiv2",
            "quickswapv2",
            "uniswapv3",
            "sushiv3",
            "quickswapv3",
            "uniswapv4",
            "uniswapv2"
        ]
    },
    {
        "name": "Arbitrum",
        "id": 42161,
        "logo": "https://files.krystal.app/DesignAssets/chains/arbitrum.png",
        "explorer": "https://arbiscan.io",
        "supportedProtocols": [
            "uniswapv2",
            "sushiv2",
            "camelotv2",
            "uniswapv3",
            "sushiv3",
            "uniswapv4",
            "pancakev2",
            "pancakev3",
            "camelotv3"
        ]
    },
    {
        "name": "Berachain",
        "id": 80094,
        "logo": "https://files.krystal.app/DesignAssets/chains/berachain.png",
        "explorer": "https://berascan.org",
        "supportedProtocols": [
            "kodiakcl"
        ]
    },
    {
        "name": "Base",
        "id": 8453,
        "logo": "https://files.krystal.app/DesignAssets/chains/base.png",
        "explorer": "https://basescan.org",
        "supportedProtocols": [
            "aerodromecl",
            "uniswapv4",
            "uniswapv2",
            "sushiv2",
            "pancakev3",
            "uniswapv3",
            "sushiv3"
        ]
    },
    {
        "name": "Ronin",
        "id": 2020,
        "logo": "https://files.krystal.app/DesignAssets/chains/ronin.png",
        "explorer": "https://app.roninchain.com/explorer",
        "supportedProtocols": [
            "katanav3",
            "katanav2"
        ]
    },
    {
        "name": "Sonic",
        "id": 146,
        "logo": "https://files.krystal.app/DesignAssets/chains/sonic.png",
        "explorer": "https://sonicscan.org",
        "supportedProtocols": [
            "shadowcl",
            "swapxcl",
            "wagmiv3"
        ]
    },
    {
        "name": "Optimism",
        "id": 10,
        "logo": "https://files.krystal.app/DesignAssets/chains/optimism.png",
        "explorer": "https://optimistic.etherscan.io",
        "supportedProtocols": [
            "uniswapv2",
            "sushiv2",
            "uniswapv3",
            "sushiv3",
            "uniswapv4"
        ]
    }
]


GET v1/protocols

Get all protocol details

Units Cost: 0

Response


GET /v1/pools

Get a list of pools across chains and protocols

Units Cost: 2

Headers:

  • KC-APIKey : string, required - the registered api key

Query Parameters:

  • chainId: string, optional - The identifier for the blockchain network combined with "ethereum". Example: ethereum@1, ethereum@8453, etc.

  • factoryAddress: string, optional . Reference: Supported protocolsarrow-up-right

  • protocol : string, optional - protocol key to filter pools. ie: uniswapv2, uniswapv3, pancakev3,... Reference: Supported protocolsarrow-up-right

  • token : string, optional - token symbol or token address to search pool

  • sortBy: integer, optional - descending sort by enum . Default is 0

  • tvlFrom: string, optional - the minimum tvl USD. Default: 1000

  • volume24hFrom : string, optional - the minimum volume USD in last 24h. Default: 1000

  • withIncentives : boolean - Include incentive data (rewards, APR) in response. Default: false

  • offset : integer, optional - The number of records to skip

  • limit : integer, optional - The maximum number of records to return. Default: 1000. Maximum: 5000

Response:

An array of JSON objects that contain the following fields:

  • chain: Object - Chain identifier. Reference: Chain objectarrow-up-right

  • poolAddress : string - the unique address of pool

  • poolPrice : double - the price of token 0 in terms of token 1

  • protocol : Object - An object with following fields:

    • name : string - Protocol's name, such as: uniswapv2, uniswapv3, uniswapv4, pancakev2, pancakev3,...

    • factoryAddress : string - the address of protocol factory

  • feeTier : integer - the fee tier of pool in BPS. eg: 3000 for pool fee 0.3%

  • token0 : Object - the token object represents token 0 in pool. Reference: Tokenarrow-up-right

  • token1 : Object - the token object represents token 1 in pool. Reference: Tokenarrow-up-right

  • tvl : double - the TVL of pool in USD

  • stats24h : Object - an object with following fields:

    • volume : double - volume USD of pool in last 24 hours

    • fee : double - fee USD of pool in last 24 hours

    • apr : double - the APR of pool in 24 hours

  • stats1h : Object - statistics of pool in last 1 hour. Similar to stats24h

  • stats7d : Object - statistics of pool in last 7 days. Similar to stats24h

  • stats30d : Object - statistics of pool in last 30 days. Similar to stats24h

  • incentives : Object - an object with following fields:

    • incentiveType : string - the type of incentive. ie: Pancake Farm, Merkl.

    • token : Object - token detail data. Reference: Tokenarrow-up-right

    • amountPerDay : double - amount of token reward that be distributed in a day

    • daily_reward_usd : double - value usd of reward in a day

    • apr24h : double - estimation of reward APR in last 24 hours data

Example Response


GET /v1/pools/:chainId/:poolAddress

Retrieve detailed information about a specific liquidity pool on a given blockchain.

Units Cost: 2

Headers:

  • KC-APIKey : string, required - the registered api key

Path Parameters

  • chainId :string, required - The identifier for the blockchain network combined with "ethereum". Example: ethereum@1, ethereum@8453, etc.

  • poolAddress : string, required - The unique address of pool.

  • factoryAddress : string, optional - Reference: Supported protocolsarrow-up-right

Response

A JSON object that contains the following fields:

  • chain: Object - Chain identifier. Reference: Chain objectarrow-up-right

  • poolAddress: string - the unique address of pool

  • poolPrice: double - Token 0 price in terms of token 1.

  • protocol: Object - Contains:

    • name: string - Protocol name, e.g., uniswapv2, pancakev3.

    • factoryAddress: string - Protocol factory address.

  • feeTier: integer - Fee tier in basis points (BPS), e.g., 3000 for 0.3% fee.

  • token0: Object - Details of token 0 in pool. Reference: Tokenarrow-up-right

  • token1: Object - Details of token 1 in pool. Reference: Tokenarrow-up-right

  • tvl: double - Total Value Locked in USD.

  • stats1h: Object - Pool statistics for the last hour.

  • stats24h: Object - Pool statistics for the last 24 hours.

  • stats7d: Object - Weekly pool statistics.

  • stats30d: Object - Monthly pool statistics.

  • incentives: Object - Current incentives.

Example Request

Sample Response

Refer to the example provided earlier for a detailed JSON response structure.


GET /v1/positions

Get list user's positions across chains and protocols

Units Cost: 10

Headers:

  • KC-APIKey : string, required - the registered api key

Path Parameters

  • wallet : string, required - the user's wallet address

  • chainId :string, optional - The identifier for the blockchain network combined with "ethereum". Example: ethereum@1, ethereum@8453, etc.

  • positionStatus : string, optional - the status of position, only accept OPEN or `CLOSED`

  • protocols : string, optional - Reference: Supported protocolsarrow-up-right

Response:

An array of JSON objects that contain the following fields:

  • chain - Object. Reference: Chain objectarrow-up-right

  • pool - Object. Reference: Pool objectarrow-up-right

  • ownerAddress - string : the user's wallet address that position belongs to

  • id - string - the unique id of position, combined by tokenAddress and tokenId

  • tokenAddress - string - the NFPM address

  • tokenId - string

  • liquidity - string : the total liquidity of position

  • minPrice - double

  • maxPrice - double

  • currentPositionValue - double

  • status - string - the status of position: IN_RANGE, OUT_RANGE, CLOSED

  • currentAmounts - Object - the current token balance of positions. An array of TokenWithValuearrow-up-right

  • providedAmounts - Object - the provided token balance of positions. An array of TokenWithValuearrow-up-right

  • tradingFee - Object - An object with following fields:

  • farmingReward - Object - An object with following fields:

  • lastUpdateBlock - integer

  • openedTime - integer

  • closedBlock - integer

  • closedTime - integer

  • closedPrice - double

  • performance - Object - An object with following fields:

    • totalDepositValue - double - total deposited amount in usd

    • totalWithdrawValue - double - total withdrew amount in usd

    • impermanentLoss - double

    • pnl - double - the profit or loss of position

    • returnOnInvestment - double

    • apr - Object - calculated by last 24h data

      • totalApr : double

      • feeApr : double

      • farmApr : double


GET /v1/positions/:chainId/:positionId

Get details of a liquidity position

Units Cost: 10

Headers:

  • KC-APIKey : string, required - the registered api key

Path Parameters

  • chainId :string, required - The identifier for the blockchain network combined with "ethereum". Example: ethereum@1, ethereum@8453, etc.

  • userAddress - string - only required when get Uniswap V2 position detail

  • positionId : string, required - the unique id of position, same data as id in response data of API get positions, combined by NFPM address and token ID.

Response: Return one object pool detail as described in API get list user's positions

Last updated