Trading · Solana devnetWatch a simulated launch ↗
Design

How Fairway works

Public onchain history tells us who trades on information. Fairway turns that into a fee schedule an AMM can enforce.

Fairway Check

The same data, for buyers: before you buy a token, see who bought it in its first minute. No wallet, no signup, no fee.

  1. Stream L
    every Pump.fun + PumpSwap trade
  2. Early buyers
    buys in the first 60 s of a token
  3. Sniper scores
    repeat early buyers, bundle flags
  4. Token metrics
    sniper share, new wallets, dumped
  5. Risk grade
    Low / Medium / High at /check

A token is graded High when known snipers hold 30% or more of its early supply (or 15% with at least half already dumped), Medium from 10%, Low below. Snipers get exposed everywhere on Solana, and taxed on Fairway.

Fair launches

Known snipers are found in Pump.fun history before a token exists, and pay a steeper launch curve. Fresh wallets pay today's time-decay fee; proven humans pay almost nothing.

  1. Stream L
    Pump.fun + PumpSwap blocks
  2. pumpfun-filter.js
    create / buy / sell per mint
  3. Sniper scores
    early buys across ≥ 3 launches
  4. Keeper
    TOXIC before slot 0
  5. configure_launch
    tier × time fee curve
  6. Launch swap
    known sniper 1000 bps, human 30
  7. Pool TWAP
    scores trades after launch

Inside the launch window each tier's fee decays linearly: TOXIC 1000 → 80 bps, STANDARD 300 → 30 (the same as a time-decay launch), RETAIL 30 → 5. A new token has no oracle, so after launch the program marks every trade against the pool's own 25-slot TWAP, 75 slots later, measured from the post-trade price so a buyer's own impact never counts as information. Bundles (fresh wallets funded by one source just before the launch) are flagged by the same Stream: they pay at least STANDARD, and TOXIC when the funder is a known bundler. Limits: snipers on fresh wallets pay the time-decay fee, and funding through an exchange or extra hops is not linked.

Pipeline

Each arrow is a component in this repo; the Stream and the keeper's devnet mode are the parts that need your accounts.

  1. QuickNode Stream
    Solana · Block dataset
  2. Filter (JS)
    swaps on pool vaults
  3. Ingest
    webhook → SQLite
  4. Scoring
    markout + shrinkage
  5. Keeper
    set_scores_batch
  6. Fairway program
    TraderScore PDA
  7. Swap
    tiered fee

Onchain verified scores (no trusted oracle)

For trades on Fairway itself, the program computes the markout score on its own. The keeper's score is only a bootstrap prior.

  1. Swap
    queues {price, slot, side, notional} in the signer’s PDA
  2. ~75 slots later
    the 30 s markout horizon passes
  3. settle_markout
    anyone cranks; reads Pyth SOL/USD
  4. Program math
    markout, shrinkage K, tier thresholds
  5. TraderScore
    onchain tier, no oracle signer
Bootstrap score (keeper). Computed offchain from a wallet's history on every venue (Raydium etc., via QuickNode Streams) and written with set_score. Lets a wallet be scored from day one. Trusted: the score authority can write any tier, limited by the TTL.
Onchain verified score (program). Once a wallet has ≥ 1,000 USDC and ≥ 5 trades of settled Fairway flow, its onchain tier is used and keeper writes no longer affect its fee. Inputs are the wallet's own swaps and Pyth (feed id, staleness and confidence checked). The same formula runs in TypeScript and Rust, checked on shared test vectors.

Why bots can't game it

  • Fresh wallets pay STANDARD (30 bps), never less. Rotating wallets only gets a bot back to the baseline fee. The backtest's rotation regime quantifies this worst case.
  • Faking RETAIL costs money. A bot needs ≥5 trades over ≥3 days with markout ≤ 3 bps. Trading uninformed is exactly giving up its edge.
  • No borrowed scores. The program derives the TraderScore PDA from the swap signer. Passing another wallet's account fails the seeds constraint (tested).
  • Keeper scores expire. A TTL in slots means a stale or missing bootstrap score falls back to STANDARD.
  • No hiding trades. Each wallet queues up to 4 unsettled trades. If the queue is full, the trade is not scored and gets no RETAIL discount.
  • No writing into someone else's score. settle_markout only accepts the PDA seeded by the trader it settles (tested).

Trade-offs we state openly

  • A retail discount is a transfer from LPs. Fairway pays for it by raising the cost to informed flow, and the sweep shows where that nets out.
  • A higher toxic fee widens the no-arbitrage band, so the pool price can be staler. We bound p95 staleness when recommending parameters.
  • The keeper is trusted for bootstrap scores (all venues). Onchain verified scores replace that trust with Pyth for Fairway's own flow. Cross-venue history still needs the keeper; ZK proofs of history are future work.
  • Settlement is a permissionless crank with no reward yet. If nobody settles within 450 slots, the trade expires unscored and the wallet stays on its current tier.
  • Aggregators: the signer is the end user, so scores follow the wallet through routers.
  • Unaudited prototype. Mock mode shows simulated data only.

Who earns what

Bots pay a premium. Part of it goes back to retail, a small part to the protocol, the rest stays with LPs.

  • Protocol share: 15% of the toxic premium only (the toxic fee above what STANDARD would pay; admin-set, max 50%). LPs keep every other fee. It stays in the vault, is excluded from LP reserves, and is claimed into the treasury PDA. A further share of the premium (10% by default) is recycled to RETAIL wallets as the bot-tax rebate: permissionless update_retail_fee sets it each epoch from the previous epoch's premium, hard-capped so the rebate can never exceed the premium collected.
  • Sponsored score accounts. The treasury pays the rent (about 0.0023 SOL) of a wallet's first score account while it holds SOL. If it is empty, the trader pays.
  • Good bots pay less. The fee follows measured markout, not who signs. Flow with no informed edge earns RETAIL pricing and a "Verified fair flow" badge, human or bot.
  • Any DEX can read the scores with one call (getFeeTier in the SDK). Licensing that is the next revenue line.
  • In the simulation the LP result versus a flat 30 bps pool is within noise before the protocol share and slightly negative after it: the benefit is a large cut in what bots extract (LVR) and retail never paying more, not a proven LP gain. See the backtest.

Tiers

RETAIL · 30 bps − rebate
score ≤ 3 bps, ≥5 trades, ≥3 days
STANDARD · 30 bps
unknown, new, or in-between
TOXIC · 80 bps
score ≥ 10 bps, ≥5 trades