Octav automatically categorizes all blockchain transactions into specific types, making it easy to filter, analyze, and understand on-chain activity.
Smart Categorization - Transactions are analyzed and categorized automatically based on method signatures, protocols, and transfer patterns
Transaction Type Enum
export enum TransactionType {
ADDLIQUIDITY = "ADDLIQUIDITY",
AIRDROP = "AIRDROP",
APPROVAL = "APPROVAL",
BORROW = "BORROW",
BRIDGEIN = "BRIDGEIN",
BRIDGEOUT = "BRIDGEOUT",
CLAIM = "CLAIM",
COLLECT = "COLLECT",
CLOSEVAULT = "CLOSEVAULT",
DEPOSIT = "DEPOSIT",
DONATION = "DONATION",
EXPENSE = "EXPENSE",
FAILED = "FAILED",
FOLLOW = "FOLLOW",
IGNORE = "IGNORE",
INTERACTION = "INTERACTION",
LEND = "LEND",
MINT = "MINT",
MULTITYPE = "MULTITYPE",
OPENVAULT = "OPENVAULT",
REPAYVAULT = "REPAYVAULT",
REMOVELIQUIDITY = "REMOVELIQUIDITY",
SIGN = "SIGN",
SELFTRANSFER = "SELFTRANSFER",
SPAM = "SPAM",
STAKE = "STAKE",
SWAP = "SWAP",
TRANSFERIN = "TRANSFERIN",
TRANSFEROUT = "TRANSFEROUT",
UNDEFINED = "UNDEFINED",
UNSTAKE = "UNSTAKE",
UNWRAP = "UNWRAP",
VOTE = "VOTE",
WITHDRAW = "WITHDRAW",
WRAP = "WRAP"
}
Transaction Categories
Transfers
DeFi Actions
Special Actions
Advanced
Meta Types
Receiving tokens from another address
- Incoming token transfers
- Received payments
- Peer-to-peer receipts
Example: Receiving USDC from a friend
Sending tokens to another address
- Outgoing token transfers
- Payments sent
- Peer-to-peer sends
Example: Sending ETH to another wallet
Moving tokens between your own wallets
- Transfers between addresses you control
- Portfolio rebalancing
- Moving funds to cold storage
Example: Moving USDT from hot wallet to hardware wallet
Receiving assets from another blockchain
- Cross-chain bridge receipts
- Assets arriving from L1 to L2
- Multi-chain transfers
Example: Bridging USDC from Ethereum to Arbitrum
Sending assets to another blockchain
- Cross-chain bridge sends
- Moving assets from L2 to L1
- Multi-chain transfers
Example: Bridging ETH from Base to Ethereum
Exchanging one token for another
- DEX trades (Uniswap, Curve, etc.)
- Token swaps
- Trading activity
Example: Swapping 1000 USDC for ETH on Uniswap
Depositing assets into a liquidity pool
- Providing liquidity on DEXs
- Entering LP positions
- Earning trading fees
Example: Adding ETH/USDC to Uniswap V3 pool
Withdrawing assets from a liquidity pool
- Removing liquidity from DEXs
- Exiting LP positions
- Collecting principal + fees
Example: Removing liquidity from Curve 3pool
Locking up assets to earn rewards
- Staking tokens
- Entering staking pools
- Beginning reward accrual
Example: Staking ETH on Lido
Withdrawing previously staked assets
- Unstaking tokens
- Exiting staking positions
- May forfeit some rewards
Example: Unstaking stETH from Lido
Supplying assets to lending protocols
- Depositing to Aave, Compound
- Earning interest
- Becoming a lender
Example: Supplying USDC to Aave
Taking a loan from lending protocols
- Borrowing against collateral
- Opening debt positions
- Paying interest
Example: Borrowing DAI on Aave against ETH collateral
Depositing funds into a protocol
- General protocol deposits
- Entering vaults
- Starting strategies
Example: Depositing into Yearn vault
Withdrawing funds from a protocol
- Removing deposits
- Exiting strategies
- Claiming principal
Example: Withdrawing from Yearn vault
Claiming rewards or distributions
- Harvesting farming rewards
- Claiming airdrop tokens
- Collecting yield
Example: Claiming UNI rewards from liquidity mining
Receiving free tokens from a project
- Airdrop distributions
- Free token allocations
- Promotional distributions
Example: Receiving ENS airdrop
Creating new tokens or NFTs
- Minting NFTs
- Creating new ERC-20 tokens
- Issuing assets
Example: Minting an NFT on OpenSea
Converting native assets to wrapped versions
- ETH → WETH
- Native tokens → ERC-20 versions
- Required for DeFi usage
Example: Wrapping ETH to WETH
Converting wrapped assets back to native
- WETH → ETH
- Returning to native form
- Gas optimization
Example: Unwrapping WETH back to ETH
Participating in onchain governance
- Voting on proposals
- DAO participation
- Protocol governance
Example: Voting on a Compound governance proposal
Granting permission to access tokens
- Token approvals for contracts
- Required before interacting with DeFi
- Security-relevant
Example: Approving Uniswap to spend USDC
Creating a new vault position
- Opening MakerDAO CDP
- Creating collateralized positions
- Starting leverage strategies
Example: Opening a vault on MakerDAO
Closing a vault after repaying debt
- Closing MakerDAO CDP
- Exiting collateralized positions
- Retrieving collateral
Example: Closing a MakerDAO vault
Paying back borrowed funds in vault
- Repaying debt
- Reducing liquidation risk
- Unlocking collateral
Example: Repaying DAI debt on MakerDAO
Gathering yield, fees, or rewards
- Collecting LP fees
- Harvesting protocol rewards
- Claiming earnings
Example: Collecting fees from Uniswap V3 position
Transaction with multiple categorizations
- Complex transactions
- Multiple actions in one tx
- Zaps and batch operations
Example: Swap + Add Liquidity in single transaction
General smart contract interaction
- Custom contract calls
- Protocol-specific functions
- Non-standard operations
Example: Calling a custom function on a protocol
Transaction that did not succeed
- Insufficient gas
- Reverted transactions
- Failed smart contract calls
Example: Swap failed due to slippage
Low-quality or unwanted transaction
- Spam airdrops
- Phishing attempts
- Irrelevant transfers
Example: Unsolicited token airdrop
Unknown or uncategorized transaction
- Novel transaction types
- Unsupported protocols
- Edge cases
Example: Interaction with new, unrecognized protocol
Transaction deliberately disregarded
- User-marked to ignore
- Filtered out
- Hidden from analysis
Example: Test transaction marked to ignore
Message signing transaction
- Off-chain signature requests
- Authentication signatures
- Gasless approvals
Example: Signing a message for authentication
Social action on blockchain
- Following users on Lens, Farcaster
- Social graph interactions
- Decentralized social
Example: Following someone on Lens Protocol
Charitable or gift transfers
- Donations to causes
- Tips to creators
- Charitable contributions
Example: Donating to Gitcoin grants
Payment for goods or services
- Paying for services in crypto
- Business expenses
- Off-chain purchases
Example: Paying for SaaS subscription in USDC
Using Transaction Types
// Get only swaps
const response = await fetch(
`https://api.octav.fi/v1/transactions?addresses=${address}&txTypes=SWAP`,
{
headers: { 'Authorization': `Bearer ${apiKey}` }
}
);
const transactions = await response.json();
console.log(`Found ${transactions.length} swaps`);
Common Patterns
DeFi Activity
Portfolio Changes
Exclude Spam
// Get all DeFi-related transactions
const DEFI_TYPES = [
'SWAP', 'ADDLIQUIDITY', 'REMOVELIQUIDITY',
'STAKE', 'UNSTAKE', 'LEND', 'BORROW',
'DEPOSIT', 'WITHDRAW', 'CLAIM'
];
const response = await fetch(
`https://api.octav.fi/v1/transactions?addresses=${address}&txTypes=${DEFI_TYPES.join(',')}`,
{
headers: { 'Authorization': `Bearer ${apiKey}` }
}
);
// Track transactions that changed portfolio
const PORTFOLIO_CHANGING = [
'TRANSFERIN', 'TRANSFEROUT', 'SWAP',
'ADDLIQUIDITY', 'REMOVELIQUIDITY',
'STAKE', 'UNSTAKE', 'DEPOSIT', 'WITHDRAW',
'CLAIM', 'AIRDROP', 'MINT'
];
function getPortfolioChanges(transactions) {
return transactions.filter(tx =>
PORTFOLIO_CHANGING.includes(tx.txType)
);
}
// Filter out unwanted transactions
const EXCLUDE_TYPES = ['SPAM', 'FAILED', 'APPROVAL', 'SIGN', 'IGNORE'];
function cleanTransactions(transactions) {
return transactions.filter(tx =>
!EXCLUDE_TYPES.includes(tx.txType)
);
}
const clean = cleanTransactions(allTransactions);
console.log(`Kept ${clean.length} of ${allTransactions.length} txs`);
Best Practices
Filter on the API side for better performance:// Good - Filter on API
const swaps = await fetch(
`https://api.octav.fi/v1/transactions?addresses=${address}&txTypes=SWAP`
);
// Less efficient - Filter client-side
const all = await fetch(
`https://api.octav.fi/v1/transactions?addresses=${address}`
);
const swaps = all.filter(tx => tx.txType === 'SWAP');
MULTITYPE transactions may need special handling:if (tx.txType === 'MULTITYPE') {
// Transaction has multiple aspects
// Check other fields for details
console.log('Complex transaction:', tx);
}
Display User-Friendly Names
Convert type enums to readable labels:const TYPE_LABELS = {
'TRANSFERIN': 'Received',
'TRANSFEROUT': 'Sent',
'SWAP': 'Swapped',
'ADDLIQUIDITY': 'Added Liquidity',
'REMOVELIQUIDITY': 'Removed Liquidity',
// ... etc
};
function getTypeLabel(txType) {
return TYPE_LABELS[txType] || txType;
}