Classifying Onchain Activity
A transaction can be a swap, a payment, a rebalance, or noise. Classification is a layer on top of canonical rows, not a replacement for them.
Context
Canonical tables say what happened at the protocol level. Product questions — “did a user pay, or did a router hop?” — need a second pass.
Method
Rules run over canonical rows and traces: if a dex.trades row is surrounded by token.transfers that net to the same user, the outer transfers are marked internal.
Findings
Most misclassification we have seen is over-labeling, not under-labeling. A conservative default of “unclassified” is cheaper to correct than a confident wrong label.
Implications for the data model
activity.classifications is additive. It never overwrites dex.trades or token.transfers. Consumers who want raw mechanics keep using the canonical tables.