Query real-time exchange rate

Description

  • Method: HTTPS POST

  • Encoding: UTF-8

  • Path: https://api.blockin.ai/v2/quot/market/exchange_rate

  • Description: Query real-time exchange rate

Request Header

Parameter
Required
Type
Description

Content-Type

Y

String

application/json

AccessKey

Y

String

1bdb01c947c54919b64d1fc6794atest

Request Parameters

Parameter
Required
Type
Description

chain_name

Y

String

Chain's name, eg:eth/Ethereum,arb/Arbitrum (Default: Ethereum)

pool_address

Y

String

Pool address

Response

Public Response

Parameter
Required
Type
Description

success

Y

Boolean

Success Boolean

data

Y

List

Response object

error_code

N

String

Error code

error_msg

N

String

Error message

Data Content

Parameter
Required
Type
Description

pool_address

Y

String

Pool address

chain_name

Y

String

Chain's name

decimal

Y

Integer

Pool's decimal

exchange_rate

Y

BigDecimal

Exchange rate

symbol0

Y

String

Symbol0 abbr

symbol1

Y

String

Symbol1 abbr

protocol_name

Y

String

Protocol name

pair_name

Y

String

Pool pair

update_at

Y

Long

Update time

timestamp

Y

Long

Timestamp

Request Sample

curl -H "Content-Type:application/json" -H "AccessKey:1bdb01c947c54919b64d1fc6794atest" "https://api.blockin.ai/v2/quot/market/exchange_rate" --data ' { "pool_address": "0xcffdded873554f362ac02f8fb1f02e5ada10516f", "chain_name":"Ethereum" }'

Successful Response Sample

{
    "success": true,
    "data": {
        "pool_address": "0xcffdded873554f362ac02f8fb1f02e5ada10516f",
        "chain_name": "Ethereum",
        "exchange_rate": "0.035420903977840789",
        "symbol0": "COMP",
        "symbol1": "WETH",
        "protocol_name": "SUSHISWAP_V2",
        "pair_name": "COMP/WETH",
        "update_at": 1689141107,
        "timestamp": 1692176441
    },
    "error_code": null,
    "error_msg": null
}

Last updated