Docs
How Trailvex gets its data, how it reads a swap, and where that stops being reliable.
Data sources
- Solana JSON-RPC for signatures, transactions, balances and token accounts. Set
RPC_MAINNET, orHELIUS_API_KEYto use the Helius RPC endpoint. The default is the public mainnet-beta endpoint. - Jupiter lite APIs for prices (
lite-api.jup.ag/price/v3) and token search (/tokens/v2/search). - DexScreener for symbol, logo, price, market cap or FDV, liquidity and pair creation time.
- Optional
NEXT_PUBLIC_RPC_WSopens alogsSubscribewebsocket per tracked wallet. A log notification triggers an immediate poll, and normal polling continues as a fallback.
Every figure shown is read from these sources. Nothing is simulated or pre-filled, and timestamps show when a number was last fetched.
Decoding rules
For each tracked wallet and each successful transaction, Trailvex computes:
- Token deltas from
preTokenBalancesandpostTokenBalanceswhere the owner is the wallet (SPL and Token-2022). - The SOL delta from
preBalancesandpostBalancesat the wallet account, with the fee added back when the wallet paid it. Wrapped SOL deltas are merged into SOL. - BUY: a token increases while SOL (or USDC/USDT) leaves. SELL: a token decreases while SOL (or USDC/USDT) arrives. SWAP: one token in and another out. Anything else involving a token is a Transfer, hidden unless filtered for.
- Movements below 0.001 SOL or 0.5 stablecoin units are not treated as a payment leg.
- Venue is read from the program IDs in the transaction: Jupiter v6, Raydium AMM / CPMM / CLMM, Orca Whirlpool, Meteora DLMM / DAMM, pump.fun and PumpSwap. Aggregator routes are labelled Jupiter, everything else is Other.
- Trade price is the quote leg divided by the token amount, converted to USD with the SOL price fetched at ingestion. Trades decoded later than two minutes after their block time are marked with a ~ (estimated).
- Market cap at trade time is estimated as the current market cap scaled by the trade price over the current price.
Convergence logic
A token is flagged when at least N distinct tracked wallets BUY the same mint within a sliding window of T minutes. Defaults are N = 2 and T = 30; N can be 2–5 and T from 5 minutes to 6 hours. The card shows the first buyer, total SOL in, the volume-weighted average entry versus the current price, and current liquidity, market cap and token age.
Polling limits per RPC
- Public RPC (default): roster capped at 15 wallets, polled every 20 seconds.
- Custom RPC or Helius: up to 100 wallets, polled every 5 seconds. The interval can be changed on supported setups.
- Each poll asks for signatures newer than the last one seen, then fetches only those transactions. Failed transactions are skipped. If a recent transaction cannot be fetched yet, the cursor is held and it is retried next poll.
- When a wallet is added, its last 100 signatures are decoded so stats appear immediately. Backfilled swaps never trigger alerts.
- The API routes use a 10 second timeout, short in-memory caches and a per-IP rate limit.
PnL caveats
Wallet stats are computed only from the swaps loaded in your browser, never from the wallet's full history. Realized PnL pairs sells against earlier buys first-in first-out, in SOL, and ignores positions opened before the loaded range, tokens moved by transfer and fees beyond the transaction fee. Win rate counts tokens with realized sells that ended in profit. Treat every figure as approximate.
Known limits
- Public RPCs prune and rate-limit history, so deep backfills can be incomplete or slow.
- Multi-hop routes that pass through several wallets, and bundled or private transactions, can be decoded as a Transfer or with a distorted size.
- Token rent and tips paid in SOL are counted inside the SOL leg.
- Tokens with no DexScreener or Jupiter listing show as a shortened mint with no price.
- The roster and rules live in your browser. Signing in with Supabase configured syncs them to your account; without it, accounts are stored locally on this device.
API route reference
GET /api/signatures?address=&until=&before=&limit=
Signatures for an address, newest first. Limit 1–100.POST /api/transactions
Body { wallet, signatures[≤50] }. Returns decoded swaps for that wallet, plus signatures that could not be fetched.GET /api/wallet/[address]
SOL balance and SPL / Token-2022 holdings valued with Jupiter.GET /api/prices?ids=
Jupiter Price API v3 lite for up to 50 mints.GET /api/tokens?mints=
Symbol, logo, price, market cap, liquidity and pair age from DexScreener, falling back to Jupiter token search. Up to 30 mints.GET /api/sol-price
SOL/USD from Jupiter, falling back to DexScreener.GET /api/rpc-health
getSlot latency and the polling limits applied for the configured RPC.
Inputs are validated with Zod, addresses are checked as 32-byte base58, and errors return JSON { "error": string }. Server environment keys are never sent to the browser.
Data, not advice. Following wallets does not guarantee profit; verify the linked transactions.