WDK logoWDK documentation

Pricing CoinGecko HTTP Overview

Overview of the @tetherto/wdk-pricing-coingecko-http module

The @tetherto/wdk-pricing-coingecko-http module provides a CoinGecko-backed PricingClient for current prices, batched price lookups, price data with 24-hour change, and historical price series.

Use it when you want a CoinGecko data source for WDK price displays, balance valuation, charts, or as a fallback client behind PricingProvider.

This module is published as v1.0.0-beta.1. It uses CoinGecko's HTTP API and is subject to CoinGecko rate limits, data availability, and API-key tier behavior.

Features

  • Current prices: Fetch one asset/currency pair with getCurrentPrice()
  • Batch prices: Fetch multiple pairs in one request with getMultiCurrentPrices()
  • Price data: Fetch last price plus derived 24-hour change with getMultiPriceData()
  • Historical series: Fetch range-based price points with optional downsampling
  • Coin ID mapping: Extend or override ticker-to-CoinGecko ID mappings per client
  • API key support: Use Demo or Pro CoinGecko API keys with automatic auth-header selection
  • Bare runtime entrypoint: Import through the package's bare export in Bare environments

Default Assets

The built-in ticker map covers:

SymbolCoinGecko ID
BTCbitcoin
ETHethereum
USDTtether
XAUTtether-gold
USATusa

Add other assets through the coinIds constructor option.

Provider Integration

CoingeckoPricingClient extends the shared PricingClient base class from @tetherto/wdk-pricing-provider. You can pass it directly to PricingProvider:

Use with PricingProvider
import { PricingProvider } from '@tetherto/wdk-pricing-provider'
import { CoingeckoPricingClient } from '@tetherto/wdk-pricing-coingecko-http'

const provider = new PricingProvider({
  client: new CoingeckoPricingClient()
})

const btcUsd = await provider.getLastPrice('BTC', 'USD')

Next Steps


Need Help?

On this page