Skip to main content

Crypto fair-value pricing from DEX trades

What is fair-value pricing from DEX trades?

Fair-value pricing from DEX trades is using swaps on decentralized exchanges (DEXs, where trades settle onchain against a pool of tokens) as inputs to accounting marks: prices at a set time such as the end-of-day close, and volume-weighted average prices (VWAP) used to check them.

Asset managers, index providers and custodian banks need it for tokens that trade mostly or partly onchain, because a fair-value mark is taken from the asset’s principal market, and for some tokens that market is a DEX.

Goldsky decodes each trade in the pools you choose and writes it to your warehouse next to your exchange data; your team builds the windows and closes and sets the mark under your valuation policy.

Who uses fair-value pricing from DEX trades?

Asset managers, index and benchmark providers, and custodian banks that value tokens traded on decentralized exchanges.

How fair-value pricing from DEX trades works

The diagram follows one price from the swaps that settle in a pool to the fair-value mark your valuation policy sets, and shows who does each step. Your setup may differ.

Your business, step 1: Choose the poolsThe DEX pools you price from
Blockchains, step 2: Trades settle on DEXsSwaps in the pools you price from
Goldsky, step 3: TurboDecode each tradePool, amounts, price and time
Your business, step 5: Build VWAP and closesBy window and venue, converted to USD
Goldsky, step 4: TurboWrite to your warehouseNext to your exchange data
Your business, step 6: Set the fair-value markYour policy picks the principal market
  • Goldsky

How to price crypto at fair value from DEX trades

A pipeline decodes every swap in the pools you price from, with its amounts and block time, and writes each one to your warehouse. Your team builds VWAPs and closes there and sets the mark.

What you’ll need

  • Goldsky Turbo
  • A list of the pools and DEXs you price from
  • A data warehouse that also holds your exchange data
  • A USD rate for each quote token
  • A valuation policy that names the principal market
  1. Choose the pools you price from

    A token can trade in many pools, and only some of them are deep and active enough to price from.

    List each pool by DEX, chain and token pair, with a reason for including it. Pricing from a thin pool lets a single small trade move your mark.

  2. Settle trades in the pool

    Each swap on a DEX settles onchain, and that record is the trade price evidence.

    A swap trades one token for another against the pool and is recorded in a block with the amounts on each side. The newest blocks can still be replaced, so a trade seen once isn’t final yet.

  3. Decode each trade

    Handled by Goldsky Turbo

    The chain stores swaps in an encoded form, and pricing needs the pool, the amounts and the time.

    Decode each swap into the pool, the amount of each token and the block time, then derive the price from the amounts and each token’s decimals. A wrong decimal count makes every price in the series wrong by a power of ten.

    With Goldsky, a Turbo pipeline can filter raw logs to Swap events by their first topic and decode them with the pool’s ABI, keeping the amounts, pool and transaction hash for every trade.

    Decode logs with an ABI (opens in a new tab)
  4. Write every trade to your warehouse

    Handled by Goldsky Turbo

    Marks are built from history and checked against other venues, so the trades belong next to your exchange data.

    Load past trades first, then each new one as it settles, keyed so that a retried write doesn’t count a trade twice. A duplicated trade inflates volume and pulls the VWAP towards its price.

    Turbo Pipelines writes each trade to your warehouse or database keyed on the event’s id; keyed tables take reorg corrections as updates and deletes, and file loads get correction records to apply.

    How delivery and reorgs work (opens in a new tab)
  5. Build VWAPs and closes

    A single trade is a noisy price, so a mark is usually a price at a set time, such as the close, checked against an average over a window.

    In your warehouse, group trades by window and venue, weight them by volume and convert each to USD with your reference rates. Decide in advance how to treat outlier trades, so the method doesn’t change after you’ve seen the result.

  6. Set the fair-value mark

    Fair value is taken from the market where the asset mostly trades, and your policy has to say which one that is.

    Your valuation policy picks the principal market for each token and the mark taken from it, and records why. A mark with no documented choice of market is the first thing auditors question.

What you control

Your team
  • Choose the pools you price from
  • Build VWAPs and closes
  • Set the fair-value mark

Security and deployment

  • SOC 2 Type IIIndependently audited security controls.
  • Dedicated infrastructureSingle-tenant options for production workloads.
  • Data residencyCloud, on-premises or co-located.

Price crypto at fair value from DEX trades with Goldsky

We’ll map it to your systems and show you what Goldsky runs, so your team builds the product, not the pipelines underneath it.

© Endless Sky Inc. All rights reserved.

PrivacyTermsSecurity

System status