Four selectors cover most retail flow through a PancakeSwap-style router: swapExactTokensForTokens, swapExactETHForTokens, swapExactTokensForETH, plus the SupportingFeeOnTransfer variants of each. Direction falls out of the path array alone. WETH in position zero means ETH entered the pool, so the wallet bought. WETH in the final position means ETH left, so it sold. A path with no WETH at either end is a token-to-token rotation and belongs in neither column.
The amountIn field is exact by construction and is the one number in the calldata you can quote as size. The amountOutMin beside it is a floor the transaction must clear or revert, never the fill. Read it as the price paid and you understate the position on every fast block, because the pool returned whatever the curve allowed above that floor. Recipient and deadline are routing and expiry metadata; they tell you where output was sent and when the call dies, nothing about value.
Verification starts with eth_getTransactionByHash over your own RPC endpoint, then ABI-decodes the input field against the router interface. BscScan's Input Data panel shows the same bytes as UTF-8 or decoded, which is fine for a first pass. Neither view contains the executed amounts. The pools write those later.
A selector match is not proof of a standard router. Forked and cloned routers reuse the same four-byte identifiers while changing fee logic, so decode the input against the interface of the contract actually at the to address, fetched with eth_getCode, not against a remembered ABI. If the decoded tuple length disagrees with the canonical signature, you are reading a modified router and every downstream number is suspect.
Every pool the router touches emits a Swap event with amount0In, amount1In, amount0Out, amount1Out and the reserves after the trade. The router emits no aggregate total. A three-hop route therefore produces three Swap events, and the output of hop one is the input of hop two. Summing the outputs as three separate purchases double-counts the position. Chain them instead: the last hop's amountOut is the only figure that reached the wallet.
Who received it is answered by ERC-20. Transfer logs, not by the signer field. The router can direct output to an address that never signed the transaction, which is routine for aggregators and for contracts buying on behalf of a treasury. Filter the Logs tab by the pool addresses in the path, read the Swap topic, then confirm the final. Transfer to the recipient matches the last hop's amountOut.
Price at that block comes from the pool contract's getReserves call pinned to the same block number as the transaction. Pinning matters. A getReserves call against latest returns a different reserve state, and the implied price drifts with every subsequent trade.
Pinning exposes a second failure mode: a pool that was created inside the same block as the swap. eth_call at block N-1 against that pair returns empty data rather than zeros, because no code existed yet. Treat empty return as "no prior state" and fall back to the Swap event's post-trade reserves, subtracting the amounts to reconstruct the pre-trade curve. Do not coerce the empty result to zero and divide.
The Swap event excludes gas. Multiply gasUsed by effectiveGasPrice from eth_getTransactionReceipt and add it to the cost side; on a congested block that leg is not noise. It also excludes any transfer fee taken by a fee-on-transfer token, which is precisely why the router exposes the SupportingFeeOnTransfer variants. On those tokens the recipient's balance delta is smaller than the Swap event's amountOut, and the gap is the fee.
Measure the delta directly. Two eth_call requests for balanceOf against the recipient, one at block N-1 and one at block N, give the true landed amount. Any shortfall against the Swap amountOut is a transfer fee or an intermediate hop you have not accounted for. Aggregator routes add a third leg: the aggregator's cut appears as its own. Transfer, usually to a fee-collecting address, and it belongs in the cost basis.
A missing receipt is not a missing trade. If eth_getTransactionReceipt returns null, the transaction is pending or your node has pruned it; re-query by hash against a second endpoint before concluding anything. Receipts also go missing when you query an archive-less node for a block older than its retention window, which returns an error rather than null. Distinguish the two: null means not yet mined on that node, an error means the node cannot answer.
Rewards do not arrive inside the swap. A claim is a separate transaction with its own selector and its own logs, and the inbound Transfer comes from the staking or reward contract rather than from a pool. No Swap event accompanies it. Read the From field on each inbound transfer: a pool address means a trade, a non-pool contract means a distribution.
The distinction changes cost basis. Tokens received as staking rewards on BSC have no purchase price in that transaction, so folding them into the swap's average entry invents capital that was never spent and inflates the position. A wallet that bought once and claimed repeatedly shows one buy and several distributions; blending them produces a fictional entry price.
Two RPC endpoints disagreeing is a signal, not a nuisance. When endpoint. A returns a receipt and endpoint B returns null for the same hash, B is behind; compare eth_blockNumber on both and trust the higher head. When both return a receipt but the logs differ in count, one node is serving a filtered or non-standard log set, and you should discard it rather than merge. Never average two sources.
Run the checks cheapest first. The selector and path give direction. The Swap events give executed size, and getReserves at the pinned block gives price. The recipient Transfer gives custody. The balance delta minus the Swap amountOut gives hidden fees. The sender address on inbound transfers separates trades from distributions.
Disagreement resolves downward. Logs beat calldata, and balances beat logs. If the Transfer to the recipient is smaller than the last hop's amountOut, the difference is a fee, not a decoding error. If a dashboard labels an inbound transfer a buy and the sender is a reward contract, the dashboard is wrong.
Apply these as decision rules. If the path has no WETH at either end, classify the row as a rotate and price both legs against pinned reserves. If the recipient's balanceOf delta is below the last hop's amountOut, book the shortfall as a transfer fee and use the delta as size. If the receipt is null on one endpoint and present on another, re-run against the higher head and ignore the lagging node. If a pool returns empty reserves at block N-1, reconstruct pre-trade reserves from the Swap event instead of assuming zero.
Thin liquidity breaks the price, not the accounting. A pool whose reserves are small relative to the trade returns an amountOut that the curve allows but that no second buyer could realize; the Swap event is still the true fill, while getReserves implies a price you cannot exit at. Report the fill and flag the depth separately rather than blending them into one "entry price."
Rebuild the whole thing from raw RPC before publishing: eth_getTransactionByHash, eth_getTransactionReceipt, then eth_call for balanceOf and getReserves at the pinned block. A conclusion that survives all three sources is safe to state. One that rests on decoded input alone is a guess with better formatting. The same discipline applies to any contract you touch, including YES token at 0xc22955b28e092060bc5d1e1f3b9d4dcd81091111 and the fee router at 0x0c9a2351e6e982b16559a68767003e7f4d02fb0d; verify addresses on chain at yesswap. vip before signing anything. Every claim above is checkable on BscScan for 0xc22955b28e092060bc5d1e1f3b9d4dcd81091111 on BNB Smart Chain (chain id 56); treat https://yesswap.vip and @web3yesswap as the only official channels.
Open YESswapIt is a slippage floor the transaction must clear or revert. The executed amount is in the pool's Swap event, and on a fast block it sits above that floor, so quoting amountOutMin understates the position.
Routers can send output to any address encoded in the call. Aggregators and treasury-buying contracts routinely route tokens to an address that never signed, so the Transfer log is the only trustworthy custody record.
Not through a standard router. A claim is a separate call with its own selector and its own inbound Transfer from the reward contract. If you see both in one hash, you are reading a custom multicall and should decode each subcall separately.
You cannot from the event alone. Compare the recipient's balanceOf at block N-1 and block N against the Swap amountOut; the shortfall is the transfer fee, and that is the real landed amount.
eth_getTransactionByHash for the input and selector, eth_getTransactionReceipt for logs and gas, then eth_call for balanceOf and getReserves pinned to the transaction's block number.
Every card below opens the live product with your own wallet — no signup, no custody.
Everything above is one page away: yes token staking.