When a transaction is classified, it is returned as a JSON object with several fields, including:
type
- The transaction type, per our standard taxonomy. For example
addLiquidity
.
- The transaction type, per our standard taxonomy. For example
description
- An English sentence describing what happened in the transaction
sent
- An array of transfers sent from the perspective address, including an
action
field that denotes what the transfer is for. For exampleaddedLiquidity
.
- An array of transfers sent from the perspective address, including an
received
- An array of transfers received by the perspective address, also including an
action
field in each case (for example,lpTokenMinted
.
- An array of transfers received by the perspective address, also including an
rawTransactionData
- An object containing the most pertinent fields from the raw transaction object. This includes the transactionHash, gas-related fields, from/to, and timestamp.
We call this a classified object.
Here's a sample classified object, as returned from our API:
{
"txTypeVersion": 2,
"chain": "polygon",
"accountAddress": "0x9B1054d24dC31a54739B6d8950af5a7dbAa56815",
"classificationData": {
"type": "removeLiquidity",
"source": {
"type": "human"
},
"description": "Removed 109,853.84 USDC and 97,129.57 agEUR from a liquidity pool.",
"sent": [
{
"action": "lpTokenBurned",
"from": {
"name": "This wallet",
"address": "0x9B1054d24dC31a54739B6d8950af5a7dbAa56815"
},
"to": {
"name": "Quickswap: v2 pool",
"address": "0x82A54e66c05FCd555ADAE593848a4257C9e51AD9"
},
"amount": "0.103002419939394076",
"token": {
"symbol": "UNI-V2",
"name": "Uniswap V2",
"decimals": 18,
"address": "0x82a54e66c05fcd555adae593848a4257c9e51ad9"
}
},
{
"action": "paidGas",
"from": {
"name": "This wallet",
"address": "0x9B1054d24dC31a54739B6d8950af5a7dbAa56815"
},
"to": {
"name": null,
"address": null
},
"amount": "0.006211997",
"token": {
"symbol": "MATIC",
"name": "Matic Token",
"decimals": 18,
"address": "MATIC"
}
}
],
"received": [
{
"action": "liquidityRemoved",
"from": {
"name": "Quickswap: v2 pool",
"address": "0x82A54e66c05FCd555ADAE593848a4257C9e51AD9"
},
"to": {
"name": "This wallet",
"address": "0x9B1054d24dC31a54739B6d8950af5a7dbAa56815"
},
"amount": "109853.843065",
"token": {
"symbol": "USDC",
"name": "USD Coin (PoS)",
"decimals": 6,
"address": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174"
}
},
{
"action": "liquidityRemoved",
"from": {
"name": "Quickswap: v2 pool",
"address": "0x82A54e66c05FCd555ADAE593848a4257C9e51AD9"
},
"to": {
"name": "This wallet",
"address": "0x9B1054d24dC31a54739B6d8950af5a7dbAa56815"
},
"amount": "97129.565093482015299955",
"token": {
"symbol": "agEUR",
"name": "agEUR",
"decimals": 18,
"address": "0xe0b52e49357fd4daf2c15e02058dce6bc0057db4"
}
}
]
},
"rawTransactionData": {
"transactionHash": "0xa29e3bb51a17967402663d01f28821dd8282c82dc49e91a598a9b4749af7c08d",
"fromAddress": "0x9B1054d24dC31a54739B6d8950af5a7dbAa56815",
"toAddress": "0xa5E0829CaCEd8fFDD4De3c43696c57F7D7A678ff",
"blockNumber": 24982518,
"gas": 255438,
"gasPrice": 31000000000,
"transactionFee": {
"amount": 6211997000000000,
"token": {
"symbol": "MATIC",
"decimals": 18
}
},
"timestamp": 1644955198
}
}
accountAddress
is the "perspective address" that the transaction is being classified from (refer to Key Concepts for a definition of this).
All of the transfers belong to either a sent or received group, and they're sent/received from the perspective of accountAddress
.
You'll see that we report the gas payment (transaction fee) as an item in the sent array. This will only be reported when the accountAddress
that you're classifying actually executed (and therefore paid for gas) the particular transaction.
By having paidGas
specifically called out when it applies, you don't have to implement logic on your side to figure out if the wallet you're tracking did or didn't pay for gas in a particular transaction.