Master Guide
Onchain Analysis and DEX Trading: Evidence and Risk
Use onchain analysis and DEX trading examples to distinguish transfers from sales, calculate price impact and inspect token permissions and liquidity.
Onchain analysis and DEX trading begin with verifiable transactions, not a label saying “smart money”. Public records show movements and contract calls. They rarely explain the owner's identity, purpose, liabilities or next decision. This guide shows how to separate an observation from a trading story, read a swap receipt yourself, set execution limits by situation and check for ordering losses after the fact.
Updated 24 October 2026 · By Adam · Examples below are original educational scenarios, not live market data or product tests.
Onchain analysis: record evidence before interpreting it
For an Ethereum transaction, capture the chain, transaction hash, block number, status, sender, destination and relevant token-transfer events. An explorer is a convenient presentation of data; compare material details with another source if a conclusion depends on them. Ethereum's oracle documentation explains why a chain cannot simply know external facts such as real-world identity.
Worked example: an exchange deposit is not a completed sale
A labelled address receives 200 ETH from wallet A. The observation is a transfer. Possible explanations include sale preparation, collateral movement, custody consolidation or an incorrect label. Before claiming selling pressure, check whether the destination label is corroborated, whether wallet A belongs to the same operator, and whether a later onchain swap actually occurred.
Keep an evidence log with three columns: observation (“200 ETH moved”), inference (“possibly a deposit”), and missing evidence (“no executed sale observed”). Confidence should follow the weakest link. Do not turn a cluster of addresses into a named person's portfolio without support.
It helps to grade each line of the log before you rely on it:
| Grade | What it means | Typical example |
|---|---|---|
| Recorded | Read directly from the chain and repeatable by anyone | A transaction succeeded in a given block and emitted a Swap event |
| Derived | Calculated from recorded data with a stated method | An execution price worked out from the event amounts |
| Attributed | Depends on a label or someone else's clustering | “This address belongs to a fund” |
| Speculative | A motive or a future action | “They are about to sell” |
A conclusion takes the lowest grade of anything it depends on. A thesis built on one attributed label is an attributed thesis, however precise the numbers around it.
Read a swap receipt field by field
Before you trust anyone's summary of a trade, including your own wallet's, read the transaction itself. On an Ethereum-style explorer, open the transaction and work through it in this order:
- Status. A failed transaction still pays a fee but moves no tokens. Do not count it as a trade.
- From and To. “From” is the signer. “To” is usually a router contract, not the pool and not your counterparty.
- Fee. Under EIP-1559, ethereum.org's gas page gives the fee as gas used multiplied by the base fee plus priority fee. The base fee is burned; the priority fee goes to the validator. Explorers show this as gas used multiplied by the effective gas price. The gas fees entry covers the mechanism.
- Logs. Find the pool's Swap event. In a Uniswap v2 style pair, the pair interface defines Swap with
amount0In,amount1In,amount0Out,amount1Outand a recipientto. The Sync event that follows records the pool's reserves after the trade. - Token order. “0” and “1” refer to the pair's
token0()andtoken1(), which you can read on the pair contract. Check which is which before reading amounts; never assume the first-named token in an interface is token0. - Units. Event amounts are raw integers. Divide by ten to the power of each token's decimals.
Worked example: the full cost of one swap from its receipt
Suppose a receipt shows a successful swap. The pair's token0 is a wrapped ETH token with 18 decimals and token1 is a dollar stablecoin with 6 decimals. The Swap event shows amount0In of 1500000000000000000 and amount1Out of 4410000000. That is 1.5 wrapped ETH in and 4,410 stablecoins out, an execution price of 4,410 / 1.5 = 2,940.
The receipt also shows 152,000 gas used at an effective gas price of 12 gwei. One gwei is one billionth of an ETH, so the fee is 152,000 × 12 = 1,824,000 gwei, or 0.001824 ETH, about $5.36 at 2,940. If the interface quoted 2,960 before signing, the quote implied 1.5 × 2,960 = 4,440. The shortfall is $30 from execution plus $5.36 in gas, $35.36 in total, or about 0.80% of the quoted value. Recording both parts tells you whether to look at pool depth or at network fees next time.
Calculate a DEX quote before setting tolerance
An automated market maker trades against reserves rather than an order book. In a basic constant-product pool the reserve product constrains the output. Newer concentrated-liquidity pools behave differently across price ranges. Uniswap's protocol overview describes the distinction.
Worked example: price impact before fees
Assume a simple pool has 1,000 token A and 1,000 token B, with no fee. Its product is 1,000,000. Adding 100 A leaves 1,100 A, so B becomes 1,000,000 / 1,100 = 909.09. The trader receives 90.91 B, although the initial one-to-one price suggested 100 B. The average execution price is 100 / 90.91 = 1.10 A per B.
The missing 9.09 B is price impact from the trade itself. Slippage tolerance is a separate limit on changes between the quote and execution. Increasing tolerance does not restore the original price, and can expose you to a worse fill. Real execution also includes pool fees, gas, routing and token-specific behaviour.
Tolerance becomes a concrete number in the transaction. The Uniswap v2 router interface, for example, takes amountOutMin and deadline alongside the amount in and the route. The router reverts if the output would fall below amountOutMin, or if the transaction is mined after the deadline. In the example above, a 0.5% tolerance on a 90.91 B quote sets a minimum of 90.91 × 0.995 = 90.46 B. Check that figure in your wallet's confirmation screen; it is the real limit, whatever percentage the interface displayed.
Choose slippage and deadline by situation
No single tolerance suits every trade. A limit that is too tight makes ordinary trades fail; one that is too loose invites a worse fill. Decide by situation:
| Situation | Main concern | What to check or set |
|---|---|---|
| Deep pool, small order | Very little; the quote is usually close | A tight minimum output; a failed trade costs only gas |
| Stablecoin to stablecoin | The output should be close to one for one | A minimum close to the input amount; a large gap means something is wrong |
| Thin pool or new token | Your own price impact and other traders' timing | Calculate impact first and shrink the order rather than widening tolerance |
| Token with a transfer fee | The fee reduces what arrives, so a standard swap may fail | Read the token's fee; Uniswap v2 has separate router functions for fee-on-transfer tokens |
| Busy network | A pending transaction executing much later at a different price | A short deadline so a stale order reverts instead of filling |
The stablecoin row has a costly dated case. On 12 March 2025 a trader swapped about 220,800 USDC for USDT in a Uniswap v3 pool and received about 5,273 USDT. EigenPhi's analysis reports that the swap's price limit was set to zero, accepting any price, and that a searcher used borrowed funds to push the pool's rate just before the trade and reverse it just after. A minimum output anywhere near the input amount would have made the transaction revert instead. The MEV entry explains why such orders attract this attention.
Check the asset, permissions and exit route
- Match the contract address and chain to the issuer's documented address. Names and ticker symbols can be copied.
- Inspect permissions: minting, freezing, upgrades and transfer restrictions. Read who controls them, not just whether the code is verified.
- Check usable liquidity for your order size. Headline volume can be artificial and is not an exit guarantee.
- Review the spender and allowance separately from the swap. Avoid a request whose meaning you cannot establish.
- Estimate both entry and exit costs, including gas in the chain's native asset. A visible token balance is not necessarily sellable.
A small successful sale is evidence about that moment, not proof that future sales will work. A token operator may change permissions; liquidity may disappear. An audit, liquidity lock or scanner score narrows particular questions without settling every risk.
To check liquidity rather than trusting a dashboard, read the pool's reserves directly. A Uniswap v2 style pair has a getReserves() read function, and the latest Sync event shows the same figures. Compare your order with the reserve of the asset you want out, not with daily volume, which the wash-trading entry shows can be manufactured.
Account for transaction ordering
Your transaction may compete with searchers and builders. Ethereum's MEV documentation describes ordering-related opportunities, including sandwich attacks. Limit tolerances, compare routes and investigate the execution policy of any protective service. “Private” routing does not make a malicious token safe.
Use the slippage entry and trading risk guide before treating a transaction feed as a strategy. Keep your evidence log even when you choose not to trade; a rejected thesis is useful research.
Spot a sandwich after the fact
If a fill was worse than expected, you can check whether ordering caused it. The procedure takes a few minutes on any explorer that lists a block's transactions in order:
- Open your transaction and note the block number and its position in the block.
- Open the block and look at the transactions immediately before and after yours.
- Check whether those two touched the same pool. A sandwich usually shows one address, or one contract, buying the asset you bought just before you and selling it just after.
- Compare the pool's Sync reserves before the first transaction with the reserves your swap traded against. The difference shows how far the price was moved before your trade.
- Record the result in your evidence log as “derived”, with the block and transaction hashes.
A worse fill can also come from ordinary competition, such as another trader's honest order landing first. Two transactions from one address wrapped around yours in the same block is the pattern to look for; a single earlier trade is not enough to call it an attack.
Verify addresses before you copy them
Onchain research ends with sending something, and that last step is where a careless copy does the most damage. In address poisoning, an attacker generates an address whose first and last characters match one you use, then sends a tiny or zero-value transfer so the lookalike appears in your history. On 3 May 2024 a holder sent 1,155 WBTC, reported by The Block at about $71 million, to such an address. Most of the value came back about a week later after negotiation, Cointelegraph reported, which is unusual. The dusting attack entry explains how these planted transfers work.
- Never copy a destination from transaction history. Take it from a saved address book entry or the recipient's own verified source.
- Compare the whole address, including the middle characters that wallets often hide.
- For a large transfer, send a small test first and confirm it arrived where expected.
- Treat unexpected tiny incoming transfers from unknown addresses as a warning, not a gift.
The wallet security checklist collects these habits with others worth adopting before any significant transfer.
Sources and verification
Primary references checked on 24 October 2026. Protocol settings and local rules can change; verify the linked version before acting.
- Ethereum: external information and oracles
- Uniswap: AMMs and liquidity
- Ethereum: MEV
- Ethereum: gas and fees under EIP-1559
- Uniswap v2 core: pair interface, Swap and Sync events
- Uniswap v2 periphery: router interface, amountOutMin and deadline
- EigenPhi: analysis of the 12 March 2025 stablecoin sandwich (secondary)
- The Block: 3 May 2024 address-poisoning loss (secondary)
- Cointelegraph: return of the poisoned WBTC funds (secondary)
Knowledge check
Apply the example before checking the answer.
Question 1 of 3Does a transfer to an exchange-labelled wallet prove a sale?
Question 2 of 3How much B does the fee-free example return for 100 A?
Question 3 of 3Does a successful small sale establish that a token is safe?