> ## Documentation Index
> Fetch the complete documentation index at: https://docs.glider.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# tRPC Crypto Market Data API

> Public CoinGecko-backed crypto discovery data for market quotes, news, trending assets, movers, market themes, platforms, and categories.

The `cryptoMarketData.*` namespace is available on the public tRPC base
endpoint:

* Base endpoint: `POST /v1/trpc`
* Namespace: `cryptoMarketData.*`
* Auth: public
* Upstream: [CoinGecko API](https://docs.coingecko.com/reference/introduction)
* Server cache: asset-data-sync writes CoinGecko records to the shared
  market-data KV cache every 10 minutes; platform-api reads that cache and does
  not call CoinGecko directly.

## Procedures

* `cryptoMarketData.getNews`
  * Purpose: fetch recent CoinGecko crypto news for the `/crypto` surface
  * Input:
    * optional `limit`, 1-20, default `8`
  * Upstream endpoint:
    [`GET /news`](https://docs.coingecko.com/reference/news)
  * Response includes normalized articles, related CoinGecko coin ids, source
    metadata, and cache metadata

* `cryptoMarketData.getMarketQuotes`
  * Purpose: fetch cached USD market quotes by CoinGecko coin id for native
    crypto symbol pages
  * Input:
    * required `coinIds`, 1-100 CoinGecko ids
  * Upstream endpoint:
    [`GET /coins/markets`](https://docs.coingecko.com/reference/coins-markets)
  * Response includes USD price, 24-hour percentage change, market cap, volume,
    market-cap rank, icon metadata, and cache metadata

* `cryptoMarketData.getGlobal`
  * Purpose: fetch cached global crypto market summary data for market overview
    surfaces
  * Input: none
  * Upstream endpoint:
    [`GET /global`](https://docs.coingecko.com/reference/crypto-global)
  * Response includes total crypto market cap, 24-hour market-cap change,
    total volume, BTC/ETH dominance, upstream update timestamp, and cache
    metadata

* `cryptoMarketData.getMarketThemes`
  * Purpose: fetch cached crypto market themes for Explore right-rail surfaces
  * Input: none
  * Upstream endpoints:
    [`GET /coins/categories`](https://docs.coingecko.com/reference/coins-categories)
    and
    [`GET /global/decentralized_finance_defi`](https://docs.coingecko.com/reference/global-defi)
  * Response includes the best and worst CoinGecko category by 24-hour market
    cap change, plus DeFi market cap, DeFi dominance, DeFi/ETH ratio, trading
    volume, top DeFi coin name, and cache metadata

* `cryptoMarketData.getTrending`
  * Purpose: fetch CoinGecko search-trending coins and categories
  * Input:
    * optional `limit`, 1-20, default `8`
  * Upstream endpoint:
    [`GET /search/trending`](https://docs.coingecko.com/reference/trending-search)
  * Response includes normalized coins, 24-hour USD change where available,
    category trend metadata, and cache metadata

* `cryptoMarketData.getTopMovers`
  * Purpose: fetch CoinGecko top gainers and losers across the top 1000 coins
  * Input:
    * optional `limit`, 1-20, default `8`
  * Upstream endpoint:
    [`GET /coins/top_gainers_losers`](https://docs.coingecko.com/reference/coins-top-gainers-losers)
  * Response includes normalized top gainers and top losers with USD price,
    1-hour, 24-hour, and 7-day percentage changes

* `cryptoMarketData.getAssetPlatforms`
  * Purpose: fetch CoinGecko asset platforms and Glider CAIP chain mappings
  * Input: none
  * Upstream endpoint:
    [`GET /asset_platforms`](https://docs.coingecko.com/reference/asset-platforms-list)
  * Response includes platform ids, chain identifiers, native coin ids, icons,
    and Glider-normalized `chainNamespace`, `chainReference`, `assetNamespace`,
    and `caipChainId` when the platform is mapped

* `cryptoMarketData.getCoinCategories`
  * Purpose: fetch CoinGecko coin taxonomy categories for indexed coins
  * Input: none
  * Upstream endpoint:
    [`GET /coins/categories/list`](https://docs.coingecko.com/reference/coins-categories-list)
  * Response includes category ids and display names

## Runtime Notes

* CoinGecko API credentials only live in asset-data-sync. Platform-api and
  browser clients consume cache records.
* Coin categories come from `/coins/categories/list`. The GeckoTerminal
  `/onchain/categories` surface is a separate onchain DEX taxonomy and is not
  used for canonical coin taxonomy.
* Market themes use `/coins/categories` sorted by
  `market_cap_change_24h_desc` and select the best/worst categories with finite
  24-hour market-cap change values.
* DeFi theme metrics use `/global/decentralized_finance_defi`.
* Top movers are cached with `duration=24h` and `top_coins=1000`.
* Market quotes are cached for the top 1000 CoinGecko coins by market cap.
* Empty arrays with `configured: true` usually mean the cache binding exists but
  the asset-data-sync refresh has not written a valid record yet.
