Skip to main content

Publisher Bot

The publisher bot updates on a cycle to

  1. Every minute, pull data from all providers. This requires an API key per provider, and must respect each provider's rate limits. A minimum provider threshold is required to reach “quorum” for a price update.
  2. Match and normalize tokens across providers. The first run takes a couple seconds on minimal hardware; after the first run we cache the cross token matches for performance.
    • Tokens often have slightly different identifiers across platforms, e.g. eth and ethereum.
    • Most of the time, a token has the same symbol across all providers.
    • If the symbol doesn't match, we look for a matching circulating supply.
  3. For each provider,
    1. Filter out
      • Tokens that do not appear in the entire quorum set of providers
      • Tokens with <$1000 volume in the last 24 hours
      • Wrapped or staked tokens
    2. Select the top 200 tokens by market cap
    3. Compute X market captop 200 market caps\frac{X\ market\ cap}{\sum top\ 200\ market\ caps} for BTCDOM, ETHDOM, and USDTDOM
  4. Take the mean of the computed dominance values across providers.
  5. Publish BTCDOM, ETHDOM, and USDTDOM prices in a single transaction to the on-chain oracle contract
    • This emits a PriceUpdate event, used by the Chart API to notify live chart subscriptions.

Note that CoinGecko is currently our only provider.