Methodology
SwapScope publishes reference prices for order-book atomic-swap markets. Everything below is implemented in the open-source pricing engine and is versioned. Current version: v1.1.0.
1. Data and definitions
Only successfully completed atomic swaps can establish a reference price. Open orders are never treated as trades. Each market is stored in one canonical direction (the higher-ranked asset is the quote; ties are broken alphabetically), so observations of RXD/LTC and LTC/RXD are directly comparable. We keep these values separate and label them as such:
- Last completed swap price: the newest completed swap, whatever its quality.
- Raw 24h VWAP and filtered 24h VWAP: volume-weighted averages over all swaps versus reference-eligible swaps.
- Best bid / best ask / midpoint: order-book values. The midpoint is never presented as a traded price.
- Reference price: the robust, confirmed price described below.
- Indicative price: the best current estimate when no reference is available (order-book midpoint or an unconfirmed trade cluster), always labelled.
- Reliable volume versus raw volume: reliable volume counts only eligible, materially unflagged trades.
2. USD conversion routes
Anchor providers (CoinGecko, CoinPaprika, the GLEEC price service) supply USD prices for quote-grade assets only: approved quotes such as LTC, BTC, KMD, DOGE and USD stablecoins. The median across providers is used; provider disagreement and age reduce route quality but are published, not hidden. A DEX-priced asset such as RXD is never priced from its own external aggregator quote; that value is shown separately for comparison.
Routes form a graph: pair reference prices (bidirectional) and anchor edges to USD. We enumerate simple paths up to 3 hops, score each by the product of hop qualities with a 10% penalty per extra hop, and select the best; ties prefer fewer hops. The selected route is always displayed (for example RXD → LTC → USD) alongside alternatives and the divergence between them.
3. Trade eligibility and weights
Every completed swap in the 7-day window is evaluated for:
- USD notional (below $5 excluded from price setting; below $1 flagged
TINY_NOTIONAL); - age (continuous decay with a 24-hour half-life);
- quote-asset quality and USD-route quality;
- deviation from a robust centre of the window (median absolute deviation, 3.5 MAD; trades more than 25% off are excluded unless they belong to a multi-participant cluster);
- execution outside the contemporaneous bid/ask spread (±2%);
- self-trades, alternating trades between the same two pubkeys, rapid round-trips, and runs of 3+ identical sizes;
- on-chain confirmation, when the source reports it.
Weight = sqrt(usdNotional) × recencyFactor × quoteQuality × routeQuality × anomalyFactor. Small trades are not deleted: they remain visible as raw activity but carry little or no weight.
4. Reference price
The reference price is a weighted median of eligible trades, after capping any single trade at 30% and any single observable participant at 40% of total weight. Because it is a median, one large trade cannot drag the price and a series of tiny trades cannot dominate it.
Repricing. The newest cluster of trades is compared with the rest of the window. A move larger than 15% becomes the reference only when confirmed by at least 3 materially unflagged trades from at least 2 observable participants, no single participant being party to more than 60% of them, with at least $20 notional over at least 30 minutes; a strong cluster (twice the trade requirement) or executable order-book support at the new level also confirms. Until then the established price is retained and the candidate is published as indicative with an UNCONFIRMED_REPRICING flag. A cluster consisting only of flagged trades is ignored (UNSUPPORTED_MOVE). Confirmed repricings supersede older trades at the old level.
5. Staleness
Freshness is the age of the newest reliable trade: under 1 hour Live, 1–12 hours Recent, 12–24 hours Low confidence, 1–7 days Stale, over 7 days No reliable current price. Confidence decays continuously between these boundaries. An order book may provide an indicative price but never resets trade age.
6. Confidence score
A 0–100 score with published components: reliable 24h USD volume (15), eligible trades (10), independent observable participants (15), age of the latest reliable trade (20), bid/ask spread (10), executable depth within 5% (10), agreement between pairs (5), agreement between anchor providers (5), share of raw volume not rejected (5), influence concentration (5). An unconfirmed repricing multiplies the score by 0.7. Levels: High ≥ 70, Medium ≥ 45, otherwise Low; Stale and Unavailable follow the freshness state.
7. Manipulation detection and its limits
Participant identifiers are keyed hashes of DEX pubkeys observable in public swap records. They let us detect repeated counterparties, self-trades and round-trips, but a determined actor can rotate keys, and an honest market maker legitimately appears in many trades. Flags therefore discount influence rather than prove intent, are published with codes and explanations, and are never claims about real-world identities. Order-book participant data is only available when SwapScope runs its own KDF node; with the public defi_stats source alone, order books carry price and volume only and the UI says so. On-chain transaction ids are not present in the public swap records, so cross-chain confirmation cannot be verified independently in this version.
8. Versioning
Raw swaps are never rewritten. When the methodology changes, the version is bumped and derived series are recalculated explicitly under the new version so that both can be compared.