Perspective-based Classification

Translate API classifications are perspective-based.

This means that the reported transaction type will vary depending on whose account/wallet address you're viewing as.

For example, an NFT trade will be classified as one of: buyNFT, sellNFT, or receiveNFTRoyalty depending on whether you're viewing the transaction as the buyer, seller, or NFT creator.

All of our relevant endpoints take a parameter where you can specify which account address you want to view transactions as.


In a system like this, an obvious question to ask is: "how do we know the classification is correct?".

Multiple components in our system are the answer to that question, including Boundaries.

Boundaries are automated checks that run upon classification. They contain rules about what is expected and what is allowed / isn't allowed in the raw data of a transaction, given the classified type.

For example, a transaction cannot be classified as a "swap" if we don't see at least one outgoing asset and one incoming asset for the perspective address.

If a boundary check fails, the transaction will not be classified with the type that failed the boundary.