Pool

This endpoint provides comprehensive information about a clipper pool, including details on its assets, the contract address of its liquidity pool, and other pertinent data. This information is crucial for making off-chain calculations and predicting quotes.

Request

Query Param
Description
Example

chain_id

Integer - Required ID of the chain.

chain_id=137 - Polygon chain_id=1 - Ethereum mainnet

time_in_seconds

Integer - Optional

The time will be available a quote, it is used for calculate the fees, as you lower the time you will see lower fees.

By default it will set a system value. For onchain data this field is not consider

time_in_seconds=30

fieldset

String - Optional Determines if should makes calls to blockchain to return onchain data. Accepted Value: "offchain-data" If the param is not added it will handle as onchain data

fieldset=offchain-data

Response

Offchain object

Field
Description

pool

assets

pairs

pool_type

String - offchain

Pool object

Field
Description

chain_id

Integer - ID of the chain

address

String(ETH address) - Clipper contract address of the pool, is the address used when executing a transaction

num_assets

Integer - The total of assets available in the chain

k

Float - K factor

time_in_seconds

Integer - Number of seconds were used to calculate the fees of a swap, this number indicates the number of seconds that quotes are live

default_time_in_seconds

Integer - Default number of seconds that quotes are live, is value used to calculate fees when don't send the query param time_in_seconds

swaps_enabled

Bool - Represents if the swaps are available for the chain

Asset object

Field
Description

name

String - The name of the asset, this value should be used when making a quote

address

String(ETH address) - The contract address of the asset

price_in_usd

Float - Current price in dollars for the asset

listing_weight

Integer - asset weight within the pool

Pair object

Field
Description

assets

List[str] - Pair of assets available to make a swap - e.g: ["ETH", "MATIC"]

fee_in_basis_points

Float - Fee for make a swap between the pair

Examples

Get the offchain data for Polygon chain (chain_id=137)

Request

curl -X GET "https://api.clipper.exchange/rfq/pool?chain_id=137&fieldset=offchain-data" -H "Authorization: Basic <base64 USERNAME:PASSWORD>"

Response

{
    "pool": {
        "chain_id": 137,
        "address": "0x6Bfce69d1Df30FD2B2C8e478EDEC9dAa643Ae3B8",
        "num_assets": 6,
        "k": 0.115,
        "time_in_seconds": 60,
        "default_time_in_seconds": 60,
        "swaps_enabled": true
    },
    "assets": [
        {
            "name": "ETH",
            "address": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
            "price_in_usd": 1656.9150000000002,
            "listing_weight": 125
        },
        {
            "name": "MATIC",
            "address": "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
            "price_in_usd": 0.56802,
            "listing_weight": 100
        },
        {
            "name": "WBTC",
            "address": "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",
            "price_in_usd": 27405.915,
            "listing_weight": 178
        },
        {
            "name": "USDC",
            "address": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
            "price_in_usd": 1.0,
            "listing_weight": 178
        },
        {
            "name": "DAI",
            "address": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
            "price_in_usd": 1.0,
            "listing_weight": 250
        },
        {
            "name": "USDT",
            "address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
            "price_in_usd": 1.0,
            "listing_weight": 305
        }
    ],
    "pairs": [
        {
            "assets": [
                "ETH",
                "MATIC"
            ],
            "fee_in_basis_points": 12.0
        },
        {
            "assets": [
                "ETH",
                "WBTC"
            ],
            "fee_in_basis_points": 6.0
        },
        {
            "assets": [
                "ETH",
                "USDC"
            ],
            "fee_in_basis_points": 8.0
        },
        {
            "assets": [
                "ETH",
                "DAI"
            ],
            "fee_in_basis_points": 8.0
        },
        {
            "assets": [
                "ETH",
                "USDT"
            ],
            "fee_in_basis_points": 8.0
        },
        {
            "assets": [
                "MATIC",
                "WBTC"
            ],
            "fee_in_basis_points": 12.0
        },
        {
            "assets": [
                "MATIC",
                "USDC"
            ],
            "fee_in_basis_points": 12.0
        },
        {
            "assets": [
                "MATIC",
                "DAI"
            ],
            "fee_in_basis_points": 12.0
        },
        {
            "assets": [
                "MATIC",
                "USDT"
            ],
            "fee_in_basis_points": 12.0
        },
        {
            "assets": [
                "WBTC",
                "USDC"
            ],
            "fee_in_basis_points": 8.0
        },
        {
            "assets": [
                "WBTC",
                "DAI"
            ],
            "fee_in_basis_points": 8.0
        },
        {
            "assets": [
                "WBTC",
                "USDT"
            ],
            "fee_in_basis_points": 8.0
        },
        {
            "assets": [
                "USDC",
                "DAI"
            ],
            "fee_in_basis_points": 5.0
        },
        {
            "assets": [
                "USDC",
                "USDT"
            ],
            "fee_in_basis_points": 5.0
        },
        {
            "assets": [
                "DAI",
                "USDT"
            ],
            "fee_in_basis_points": 5.0
        }
    ],
    "pool_type": "offchain"
}

Last updated