Skip to main content
Clicker provides Realized PNL for onchain trading activity. This document explains what we provide, what you need to bring, and how our PNL calculations work.

What Clicker Provides

How PNL Works

The Basic Flow

When you buy tokens and later sell them, Clicker tracks the cost basis and computes your realized gain or loss:

How Receives Are Handled

On-chain, tokens can arrive without a purchase - airdrops, bridge transfers, staking rewards, payments. Clicker assigns a cost basis at market price when received:

FIFO Lot Matching

When you sell tokens, Clicker uses FIFO (First In, First Out) to determine which tokens are sold first. Each acquisition creates a “lot” with its own cost basis:

Position-Based PnL (Not Token-Based)

Clicker uses position-based PnL tracking, which is the standard approach used by leading trading apps like Axiom and fomo. This differs from token-based systems that aggregate all activity on a token into a single view.

How It Works

When you buy a token, Clicker opens a position. When you sell all of it, that position closes. If you re-enter that same token later, a new position opens with its own separate PnL:

Why Position-Based Matters

With position-based tracking, each position stands on its own. This makes it easier to:
  • Reason about your trading history - See exactly how each entry into a token performed
  • Evaluate current positions clearly - Your new entry’s PnL isn’t clouded by gains or losses from previous trades in the same token

Token-Based Systems Are Different

Some portfolio trackers use token-based PnL, which aggregates all activity on a token into one combined view. In the example above, a token-based system would show:
This makes it harder to evaluate your current position because past profits inflate or past losses deflate your view of the new trade. If you’re comparing PnL data across different platforms, be aware that portfolio trackers may use token-based aggregation, which will show different numbers.

Trade Types: Buys, Sells, and Swaps

Clicker categorizes every trade based on the tokens involved. This determines how we price each side of the trade.

Quote Tokens

Quote tokens are the “base currencies” of crypto trading:
  • Native assets: ETH, SOL, and other chain-native tokens
  • Stablecoins: USDC, USDT, DAI, and other standard stablecoins
These are the tokens traders typically use to enter and exit positions.

How We Categorize Trades

How We Price Trades

Every trade has two sides: the token you send (sold) and the token you receive (bought). Clicker prices both sides independently at the block timestamp, then uses the appropriate side to determine trade value:

Why We Price This Way

  • Buys: The quote token (ETH, USDC) has reliable pricing. We use it to determine what you paid for the new token.
  • Sells: The quote token you receive has reliable pricing. We use it to determine your proceeds.
  • Swaps: Neither token is a quote token, so we price both independently. The sold token’s value becomes the cost basis for what you bought, and the bought token’s value determines the sale proceeds for what you sold. These values may differ slightly due to liquidity differences.
This approach ensures consistent PnL tracking even when trading between volatile assets.

What You Need to Bring: Unrealized PNL

Clicker does not provide realtime token prices. We focus on the hard accounting problem - tracking cost basis and computing realized gains - while you retain control over pricing. You combine our data with your live prices to compute unrealized PnL, current position value, and percent change. See the Position Calculations guide for the full formulas covering both spot and perp positions.

Why PNL Is Harder Than It Looks

Building accurate PNL for onchain trading involves solving several interconnected problems:

Swap Detection

A blockchain transaction is just a list of token transfers. Determining whether those transfers represent a buy, sell, swap, airdrop, bridge, or something else requires parsing balance changes, identifying contract patterns (DEX routers, bridges), handling multi-hop swaps, and distinguishing intentional trades from fees, MEV, and dust.

Cost Basis Tracking

Each acquisition creates a lot record: (token, amount, unit_price, timestamp, type). Partial sales consume lots in FIFO order, splitting lots when necessary. Receives are priced at market rate via Codex at transaction time.

Position Lifecycle

Position opens on first acquisition, closes when remaining value drops below the dust threshold of $1. Re-acquiring after full sale opens a new position with fresh lots.

Edge Cases

Failed transactions with partial state changes, LP token mints/burns, and cross-chain trades.

What We Handle

Clicker solves these problems so you don’t have to:
  • Swap derivation from raw transaction data
  • Cost basis tracking across acquisitions
  • FIFO accounting for sales
  • Position lifecycle management
  • Cross-chain awareness for common bridges
  • Historical pricing at transaction time (via Codex)
You get clean, computed PNL data. We handle the complexity.

Summary