Portfolio API

Get Address DEX Transaction List#

Get the historical DEX transaction list of the address in reverse chronological order

Limit: 1000 records, up to 100 per request

Request Path#

GET https://web3.okx.com/api/v6/dex/market/portfolio/dex-history

Request Parameters#

ParameterTypeRequiredDescription
chainIndexStringYesUnique identifier of the chain, pass the chain ID (e.g., 501 for Solana)
walletAddressStringYesWallet address to query
beginStringYesStart timestamp (milliseconds)
endStringYesEnd timestamp (milliseconds)
tokenContractAddressStringNoToken contract address; if not provided, returns transactions for all tokens
typeStringNoTransaction type: 1=BUY, 2=SELL, 3=Transfer In, 4=Transfer Out, supports comma-separated multiple types
cursorStringNoPagination cursor, pass the cursor value returned from the previous request
limitStringNoNumber of records per page, max 100

Response Parameters#

ParameterTypeDescription
transactionListArrayTransaction list
>typeStringTransaction type (1=BUY, 2=SELL, 3=Transfer In, 4=Transfer Out)
>chainIndexStringUnique identifier of the chain
>tokenContractAddressStringToken contract address
>tokenSymbolStringToken symbol
>valueUsdStringTransaction value (USD)
>amountStringToken amount
>priceStringTransaction price
>marketCapStringMarket cap
>pnlUsdStringPnL (USD)
>timeStringTransaction timestamp (milliseconds)
cursorStringPagination cursor for retrieving the next page of data

Request Example#

Shell
curl --location --request GET 'https://web3.okx.com/api/v6/dex/market/portfolio/dex-history?chainIndex=1&walletAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&begin=1700000000000&end=1710000000000&limit=10' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'

Response Example#

Json
{
    "code": "0",
    "data": {
        "transactionList": [
            {
                "type": "1",
                "chainIndex": "1",
                "tokenContractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                "tokenSymbol": "USDT",
                "valueUsd": "1000.00",
                "amount": "1000",
                "price": "1.00",
                "marketCap": "100000000000",
                "pnlUsd": "50.00",
                "time": "1709900000000"
            }
        ],
        "cursor": "0"
    },
    "msg": ""
}