Query swap list by chain name and token address

Description

  • Method: HTTPS POST

  • Encoding: UTF-8

  • Path: https://api.blockin.ai/v2/dexs/token/swap_list

  • Description: Query the swap list of a pool

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, only support ethereum

address

Y

String

Token address

page

Y

Integer

Page num

page_size

Y

Integer

Page size (The maximum size is 100)

start_usd_value

N

BigDecimal

minimum usd value

end_usd_value

N

BigDecimal

maximum usd value

start_timestamp

N

Long

Start time (Default is the last three months, timestamp in seconds)

end_timestamp

N

Long

End time (Timestamp in seconds)

Response

Public Response

Parameter
Required
Type
Description

success

Y

Boolean

Success Boolean

data

Y

JSONObject

Response object

error_code

N

String

Error code

error_msg

N

String

Error message

Response Content

Parameter
Required
Type
Description

total

Y

Integer

Total number

current

Y

Integer

Current page number

count_page

Y

Integer

Total page number

page_size

Y

Integer

Current page size

records

Y

List

Paginated list

Records Content

Parameter
Required
Type
Description

account

Y

String

User address

protocol_name

Y

String

Protocol's name

project_name

Y

String

Project's name

logo_url

Y

String

Logo's url

site_url

Y

String

Website's url

pool_address

Y

String

Pool address

block_time

Y

Long

Transaction time (Timestamp in seconds)

type

Y

String

Type (buy,sell)

input_token

Y

Object

Token info

out_token

Y

Object

Token info

usd_value

Y

BigDecimal

USD value

tx

Y

String

Transaction hash

Input token, out token Content

Parameter
Required
Type
Description

address

Y

String

Token's address

name

Y

String

Token's name

symbol

Y

String

Token's symbol

decimal

Y

Integer

Token's decimal

amount

Y

BigDecimal

Token's amount

price

N

BigDecimal

Token's price

logo_url

Y

String

Token's logo

Request Sample

curl -X POST 'https://api.blockin.ai/v2/dexs/token/swap_list' -H 'Accesskey: 1bdb01c947c54919b64d1fc6794atest' -H 'Content-Type: application/json' --data '{"chain_name":"eth","address":"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599","page":1,"page_size":20,"start_usd_value":27490,"end_usd_value":27498,"start_timestamp":1695285875,"end_timestamp":1696285875}'

Successful Response Sample

{
    "success": true,
    "data": {
        "total": 1,
        "current": 1,
        "count_page": 1,
        "page_size": 20,
        "records": [
            {
                "protocol_name": "curve",
                "project_name": "Curve",
                "logo_url": "https://www.blockin.ai/image/protocol/curve.png",
                "site_url": "https://curve.fi",
                "pool_address": "0xc4ad29ba4b3c580e6d59105fff484999997675ff",
                "account": "0xa69babef1ca67a37ffaf7a485dfff3382056e78c",
                "block_time": 1695850235,
                "type": "sell",
                "input_token": {
                    "address": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
                    "name": "Wrapped BTC",
                    "symbol": "WBTC",
                    "decimal": 8,
                    "amount": 1.04761540,
                    "price": 26245.229431723060924613,
                    "logo_url": "https://www.blockin.ai/image/token/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599.png"
                },
                "out_token": {
                    "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                    "name": "Tether USD",
                    "symbol": "USDT",
                    "decimal": 6,
                    "amount": 27518.154201,
                    "price": 1.000827321657972853,
                    "logo_url": "https://www.blockin.ai/image/token/0xdac17f958d2ee523a2206206994597c13d831ec7.png"
                },
                "usd_value": 27494.906529206327159763,
                "tx": "0x4a80f3e72b5b04cd42acf1777f7dd9b6115393312c2a7b5ad4729038751ab5b1"
            }
        ]
    },
    "error_code": null,
    "error_msg": null
}

Failed Response Sample

{
    "success": false,
    "data": null,
    "error_code": "Unauthorized",
    "error_msg": "AccessKey status error"
}

Last updated