Documentation Index
Fetch the complete documentation index at: https://docs.codex.io/llms.txt
Use this file to discover all available pages before exploring further.
This data powers the wallet discovery, tracking, and portfolio features on defined.fi:

Discover High-Performing Wallets
Example using the filterWallets endpoint
Example using the filterWallets endpoint
Find Token-Specific Traders
Example using the filterTokenWallets endpoint
Example using the filterTokenWallets endpoint
Get Detailed Wallet Analytics
Example using detailedWalletStats endpoint
Example using detailedWalletStats endpoint
Example using getTokenEventsForMaker endpoint
Example using getTokenEventsForMaker endpoint
backfillWalletAggregates mutation found here.Visualize Wallet Activity
Example using walletChart endpoint with a 30-day timeframe
Example using walletChart endpoint with a 30-day timeframe

Calculate Wallet PnL
Overall Realized PnL
ThedetailedWalletStats endpoint provides aggregate realized PnL across configurable timeframes. The statsUsd object within each timeframe contains realizedProfitUsd (total USD profit/loss from closed positions) and realizedProfitPercentage.statsDay1, statsDay7, statsDay30, and more — each providing the same PnL fields for that rolling window.Per-Token PnL
To see how a wallet performed on a specific token, usefilterTokenWallets. This gives you per-token realized PnL across timeframes:Example: Per-token PnL for a wallet
Example: Per-token PnL for a wallet
Unrealized PnL
To estimate unrealized PnL (profit/loss on tokens still held), compare the current value of held tokens against their acquisition cost:filterTokenWallets:tokenAcquisitionCostUsd— what the wallet paid for the tokens it still holds- Current value — multiply
tokenBalanceby the token’s current price (fromgetTokenPrices)
heldTokenAcquisitionCostUsd field from detailedWalletStats gives you the total cost basis across all held tokens for a wallet.PnL Over Time
For charting PnL progression, use thewalletChart endpoint (shown in Visualize Wallet Activity above). The realizedProfitUsd field in each data point gives you time-series PnL data at your chosen resolution.Check Current Holdings
Example using the balances endpoint
Example using the balances endpoint
Bring Your Results Together
- Discovery: Use filterWallets to find high-performing wallets\
- Token Analysis: Use filterTokenWallets for token-specific performance\
- Deep Dive: Use detailedWalletStats and EventsForMaker for a comprehensive wallet analysis\
- Visualization: Use walletChart for time-series performance data\
- Token Holdings: Use balances to see current holdings and USD values
Assign Wallet Labels (Optional)
- Wealthy (low): Wallet holds $1M+ in assets
- Wealthy (Medium): Wallet holds $5M+ in assets
- Wealthy (high): Wallet holds $10M+ in assets
- Sniper: Profits $3k+ from tokens bought within 1 hour of launch
- Interesting: Wallet is interesting (based on a number of factors).
- Early Bird (Smart Trader): Profits $5k+ from tokens 1 hour to 2 days old
- Second Wave (Smart Trader): Profits $7.5k+from established tokens (2+ days old)
- Scammer or Bot: Wallets that have suspicious trading behavior. Stats not tracked.
Check out the related wallet endpoints in their respective API reference pages: