Coins: 17,404
Exchanges: 1,487
Market Cap: $2.233T 0.4%
24h Vol: $61.474B
Gas: 0.136 GWEI
Upgrade to Premium
TABLE OF CONTENTS

How LI.FI Prices Cross-Chain Swaps for 2M+ Assets Across 40+ Networks

CoinGecko -

LI.FI is the universal liquidity layer that connects any application to all onchain liquidity across chains, bridges, DEXs, solvers, and yield protocols through a single integration. Its API and SDK abstract the complexity of bridging, swapping, and executing transactions across 40+ blockchain networks, enabling developers to move any asset seamlessly. Today, more than 1,000 B2B integrators rely on LI.FI's infrastructure, including consumer wallets such as MetaMask, Phantom, Ledger Live, and Rabby, fintech platforms such as Robinhood, Kraken, and Circle, and institutional trading desks operating at enterprise scale.

By integrating CoinGecko's API, LI.FI powers its token service architecture with accurate, real-time price data across more than 2 million tokens, delivering the pricing freshness its integrators and their end users demand.


Key Metrics at a Glance

  • By integrating CoinGecko’s API, LI.FI's token service delivers real-time, accurate pricing across 2M+ tokens spanning 40+ blockchain networks, giving its 1,000+ B2B integrators a single, reliable pricing source for every asset they support.

  • LI.FI leverages CoinGecko's WebSocket API to deliver price updates every second for thousands of the most traded tokens, eliminating the need for aggressive REST polling on assets where real-time freshness matters most.

  • LI.FI's 8-tier bucketing system, which uses Coingecko's REST and WebSocket capabilities as the main token price oracles, processes approximately 1 billion token price updates per month while using 80% fewer API calls than a uniform polling approach, keeping API costs efficient at enterprise scale without compromising on price freshness.


The Challenge: Pricing 2M+ Tokens Accurately at Scale

LI.FI operates one of the most complex token pricing environments in DeFi. Its bridge and DEX aggregation protocol spans 40+ blockchains and serves more than 1,000 B2B integrators, each with different latency tolerances, liquidity profiles, and user-facing SLA requirements.

The core engineering challenge was designing a pricing system capable of serving those 2 million tokens simultaneously, where each token carried a different freshness requirement depending on its trading activity, volatility, and how frequently end users interacted with it. A single uniform polling cadence was not viable at that scale. Applying the same update frequency to every token would either exhaust API rate limits on high-activity assets or leave low-liquidity tokens underserved during periods of market stress. LI.FI needed an architecture that could dynamically match data freshness to token behavior, maintain rate efficiency across the full token universe, and hold up under production load without manual tuning.


Why LI.FI Chose CoinGecko API

LI.FI built its token service to be provider-agnostic with a standardized oracle adapter layer that can run multiple price sources in parallel. After evaluating more than a dozen oracles on network coverage and data freshness, the team chose CoinGecko as its primary reference provider for four core reasons:

  • Broadest token coverage: CoinGecko tracks the long tail of tokens across 40+ chains, which is critical for a protocol that must price any asset a user wants to swap.

  • WebSocket streaming: CoinGecko’s real-time price delivery via WebSocket allows LI.FI to update volatile token prices every second, eliminating the need for aggressive REST polling on high-activity assets.

  • Consolidation without lock-in: CoinGecko's breadth of coverage allowed LI.FI to consolidate its primary oracle to a single provider, reducing operational overhead.

  • Onchain token discovery: CoinGecko's onchain data endpoints help LI.FI discover new tokens as they begin trading, feeding directly into its automated token discovery pipeline.

What LI.FI Says About CoinGecko API

"We evaluated over a dozen token price oracles before choosing CoinGecko as our reference provider. Our token service architecture is designed to be provider-agnostic — we can integrate any oracle — but no other API matched CoinGecko's combination of coverage across 250+ chains, real-time WebSocket delivery, and the depth of onchain data we need for automated token discovery. CoinGecko's API is what allows us to deliver enterprise-grade price freshness to clients like Robinhood, Ledger, and MetaMask."

— Clément Bihorel, Product Lead at LI.FI


How LI.FI Leverages CoinGecko API

CoinGecko is the primary data source powering LI.FI's token service, which handles all token pricing, discovery, and classification for the entire protocol. Every cross-chain quote, swap, and bridge transaction depends on accurate, fresh token prices, making the data central to the product. The integration spans both REST and WebSocket layers, with CoinGecko connected through a standardized oracle adapter that supports parallel operation with additional providers, automatic fallback chains, and circuit breaker logic for resilience under production conditions.

Batch Price Data via REST API

For the majority of its token universe, LI.FI queries CoinGecko's REST API in batches of up to 50 tokens per call. The /onchain/networks/{network}/tokens/multi/{ids} endpoint handles the heaviest share of this volume, retrieving price and market data for multiple onchain tokens in a single query across supported networks. Alongside it, the /simple/token_price/{id} endpoint handles batch price lookups for tokens identified by contract address on a specific blockchain, complementing the onchain endpoint across different query patterns.

In aggregate, LI.FI processes approximately one billion individual token price updates per month through these two endpoints, equating to roughly 22 million API calls at 50 tokens per batch.

Real-Time Price Streaming via WebSocket

CoinGecko's WebSocket API delivers real-time price updates every second for thousands of the most traded tokens. Rather than polling for price changes at a fixed interval, the WebSocket connection pushes updates as they happen.

The widget below illustrates this in practice. When a user compares swap routes across liquidity providers like Hyphen, Across, and Circle CCTP, LI.FI's routing engine evaluates those options against WebSocket-streamed price data from CoinGecko, returning the most accurate and up-to-date quote for each path in real time.

LI.FI swap widget showing live route comparison with real-time price quotes (USDC to ETH, Polygon, three live route options with pricing).

Additional REST endpoints support supplementary data needs across the token service. The /coins/markets endpoint provides market cap and volume context for tokens. The /coins/{id}/market_chart/range endpoint supports historical price lookups where needed.

Onchain Token Discovery

LI.FI’s token database covers over two million assets across 40+ networks, a scale that makes manual token curation impossible. To keep the database current as new tokens launch, LI.FI runs an automated discovery pipeline built on CoinGecko’s onchain endpoints.

When LI.FI’s system detects activity around an unrecognized contract address, it queries CoinGecko’s /onchain/networks/{network}/tokens/multi/{ids} endpoint to retrieve verified token metadata, pricing context, and network classification. Tokens that qualify are automatically added to the token service, assigned a pricing tier, and begin receiving price updates.

Data Infrastructure Optimization

Across both data streams, LI.FI's token service applies an 8-tier bucketing system that classifies every token by its trading activity and volatility. High-activity tokens refresh every second, with WebSocket streaming used where possible. Dormant tokens refresh at a lower cadence matched to their actual demand. This tiered architecture is what allows LI.FI to process approximately one billion monthly price updates with 80%+ fewer API calls than a uniform polling approach would require, while maintaining enterprise-grade price freshness on the assets that users trade most.


Business and User Outcomes

Building a token service that prices 2M+ assets at enterprise scale is a tough infrastructure challenge. CoinGecko's API gave LI.FI the data foundation to overcome it, delivering measurable results across price freshness, API efficiency, and automated token discovery.

Real-Time Price Freshness at Scale

By building its token service around CoinGecko's API, LI.FI delivers price updates every second on its most-traded assets while maintaining full pricing coverage across 2M+ tokens. For integrators like Robinhood, Ledger, and MetaMask, this translates directly into more accurate swap quotes, tighter slippage, and a better end-user experience at enterprise scale.

API Efficiency Through Intelligent Tiering

The 8-tier bucketing system, designed specifically around CoinGecko's REST and WebSocket capabilities, achieved an 80%+ reduction in API call volume compared to a uniform polling approach. For LI.FI, the result is a leaner API cost structure at enterprise scale. The protocol prices over two million tokens monthly without the infrastructure spend that uniform polling demands.

Automated Token Discovery at Scale

LI.FI’s token database expands automatically as new assets launch across 40+ networks. For enterprise integrators like Robinhood and Ledger, this means that new token coverage arrives without any action required on their end. Furthermore, CoinGecko's coverage of over 250+ networks with normalized data allows LI.FI to easily extend its token service to new chains without rebuilding its data layer.


What’s Next On The Roadmap

With its token pricing infrastructure in place, the LI.FI team is extending its use of CoinGecko’s real-time data into the universal liquidity execution stack through Smart Slippage v2. This new service calculates dynamic, per-token slippage recommendations by combining real-time price data from CoinGecko with LI.FI’s own DEX aggregation layer and volatility signals. Smart Slippage v2 provides high-precision, per-token slippage that replaces the static defaults common across the industry. Built to meet requirements from enterprise clients like Robinhood, the feature is scheduled to launch in Q2 2026.


Get In Touch

Ready to supercharge your crypto project? Fill in the form below to connect with our API Sales team for a custom CoinGecko API plan tailored to enterprise needs.

 

This article was written in collaboration with LI.FI team.

CoinGecko's Content Editorial Guidelines
CoinGecko’s content aims to demystify the crypto industry. While certain posts you see may be sponsored, we strive to uphold the highest standards of editorial quality and integrity, and do not publish any content that has not been vetted by our editors.
Learn more
Want to be the first to know about upcoming airdrops?
Subscribe to the CoinGecko Daily Newsletter!
Join 600,000+ crypto enthusiasts, traders, and degens in getting the latest crypto news, articles, videos, and reports by subscribing to our FREE newsletter.
Tell us how much you like this article!
CoinGecko
CoinGecko
CoinGecko's editorial team comprises writers, editors, research analysts and cryptocurrency industry experts. We produce and update our articles regularly to provide the most complete, accurate and helpful information on all things cryptocurrencies. Follow the author on Twitter @coingecko

More Articles

New Portfolio
Icon & name
Select Currency
Suggested Currencies
USD
US Dollar
IDR
Indonesian Rupiah
TWD
New Taiwan Dollar
EUR
Euro
KRW
South Korean Won
JPY
Japanese Yen
RUB
Russian Ruble
CNY
Chinese Yuan
Fiat Currencies
AED
United Arab Emirates Dirham
ARS
Argentine Peso
AUD
Australian Dollar
BDT
Bangladeshi Taka
BHD
Bahraini Dinar
BMD
Bermudian Dollar
BRL
Brazil Real
CAD
Canadian Dollar
CHF
Swiss Franc
CLP
Chilean Peso
CZK
Czech Koruna
DKK
Danish Krone
GBP
British Pound Sterling
GEL
Georgian Lari
HKD
Hong Kong Dollar
HUF
Hungarian Forint
ILS
Israeli New Shekel
INR
Indian Rupee
KWD
Kuwaiti Dinar
LKR
Sri Lankan Rupee
MMK
Burmese Kyat
MXN
Mexican Peso
MYR
Malaysian Ringgit
NGN
Nigerian Naira
NOK
Norwegian Krone
NZD
New Zealand Dollar
PHP
Philippine Peso
PKR
Pakistani Rupee
PLN
Polish Zloty
SAR
Saudi Riyal
SEK
Swedish Krona
SGD
Singapore Dollar
THB
Thai Baht
TRY
Turkish Lira
UAH
Ukrainian hryvnia
VEF
Venezuelan bolívar fuerte
VND
Vietnamese đồng
ZAR
South African Rand
XDR
IMF Special Drawing Rights
Cryptocurrencies
BTC
Bitcoin
ETH
Ether
LTC
Litecoin
BCH
Bitcoin Cash
BNB
Binance Coin
EOS
EOS
XRP
XRP
XLM
Lumens
LINK
Chainlink
DOT
Polkadot
YFI
Yearn.finance
SOL
Solana
Bitcoin Units
BITS
Bits
SATS
Satoshi
Commodities
XAG
Silver - Troy Ounce
XAU
Gold - Troy Ounce
Select Language
Popular Languages
EN
English
RU
Русский
DE
Deutsch
PL
język polski
ES
Español
VI
Tiếng việt
FR
Français
PT-BR
Português
All Languages
AR
العربية
BG
български
CS
čeština
DA
dansk
EL
Ελληνικά
FI
suomen kieli
HE
עִבְרִית
HI
हिंदी
HR
hrvatski
HU
Magyar nyelv
ID
Bahasa Indonesia
IT
Italiano
JA
日本語
KO
한국어
LT
lietuvių kalba
NL
Nederlands
NO
norsk
RO
Limba română
SK
slovenský jazyk
SL
slovenski jezik
SV
Svenska
TH
ภาษาไทย
TR
Türkçe
UK
украї́нська мо́ва
ZH
简体中文
ZH-TW
繁體中文
Welcome to CoinGecko
Welcome back!
Login or Sign up in seconds
or
Sign in with . Not you?
Forgot your password?
Didn't receive confirmation instructions?
Resend confirmation instructions
Password must contain at least 8 characters including 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character
By continuing, you acknowledge that you've read and agree fully to our Terms of Service and Privacy Policy.
Get Price Alerts with CoinGecko App
Forgot your password?
You will receive an email with instructions on how to reset your password in a few minutes.
Resend confirmation instructions
You will receive an email with instructions for how to confirm your email address in a few minutes.
Get the CoinGecko app.
Scan this QR code to download the app now App QR Code Or check it out in the app stores
Add NFT
Track wallet address
Paste
Read-only access - we can’t make changes to your wallet.
We currently support the following EVM networks:
Ethereum Mainnet
Base Mainnet
BNB Smart Chain
Arbitrum
Avalanche
Fantom
Flare
Gnosis
Linea
Optimism
Polygon
Polygon zkEVM
Scroll
Stellar
Story
Syscoin
Telos
X Layer
Xai
Support for Solana is coming soon.
or
Create Portfolio
Select icon
💎
🔥
👀
🚀
💰
🦍
🌱
💩
🌙
🪂
💚
CoinGecko
Better on the app
Real-time price alerts and a faster, smoother experience.
You’ve reached the limit.
Guest portfolios are limited to 10 coins. Sign up or log in to keep the coins listed below.