Chains, tokens, prices and balances
Build chain and token pickers from every chain and token LayerHop routes, and show USD prices and wallet balances — endpoints, parameters, caching and SDK calls.
LayerHop serves the asset data a swap UI needs through six public endpoints: GET /v1/chains (the 71 chains its providers route), GET /v1/tokens and GET /v1/tokens/lookup (token search and metadata), GET /v1/tokens/{chain}/{address}/risk (a token risk report), GET /v1/prices (USD prices) and GET /v1/balances (a wallet's holdings). The LayerHop swap app uses the same calls.
Which endpoints are there?#
| Endpoint | Returns | Server cache | SDK |
|---|---|---|---|
GET /v1/chains |
Every routable chain, popular first | Registry refreshed every 6 h | lh.chains() |
GET /v1/tokens |
One chain's tokens, searchable and paged | Token lists refreshed hourly | lh.tokens({ chain, q, limit, cursor }) |
GET /v1/tokens/lookup |
One token by address or mint, even if unlisted; chain optional |
1 h | lh.lookupToken(chain, address) or lh.lookupToken(address) |
GET /v1/tokens/{chain}/{address}/risk |
A token's risk report (honeypot, taxes, owner powers, fake majors) | 10 min | (HTTP only for now) |
GET /v1/prices |
USD prices for up to 100 tokens | 60 s | lh.prices(ids) |
GET /v1/balances |
A wallet's non-zero balances with USD values, plus any tokens you name | 20 s per address and chain (fresh=1 skips it) |
lh.balances(address, chains?, { tokens?, fresh? }) |
All six count toward your rate limit. Responses from /chains and /tokens are also cacheable by browsers and CDNs for 5 minutes.
How do I list chains?#
GET /v1/chains returns every chain at least one provider can quote from or to. The registry merges the chain lists of Relay, LI.FI, deBridge, KyberSwap, Mayan, 0x and Jupiter, refreshes every 6 hours, and falls back to a built-in snapshot when providers are unreachable. Popular chains (popular: true) come first, then the rest alphabetically.
const chains = await lh.chains();
const bera = chains.find((c) => c.slug === "berachain");
// { id: 80094, slug: "berachain", name: "Berachain", vm: "evm", nativeSymbol: "BERA", nativeDecimals: 18,
// logoURI: "https://…", explorerTx: "https://berascan.com/tx/", explorerAddress: "https://berascan.com/address/",
// providers: ["kyberswap", "lifi", "relay", "zerox"], popular: true }| Field | Meaning |
|---|---|
id |
EVM chain id, or 7565164 for Solana |
slug |
Stable name such as base, hyperevm, robinhood |
vm |
evm or svm |
nativeSymbol, nativeDecimals |
The gas coin |
explorerTx, explorerAddress |
Prefixes; append a hash or an address |
providers |
Providers that route from or to the chain |
popular |
Shown first in pickers |
Each chain LayerHop has probed also carries routeHealth: every ~2 hours LayerHop quotes about $25 from Base USDC into the chain (in) and back out (out), with its native coin, its canonical stablecoin and WETH (a direction works when any of them gets a quote). A direction is failing after two failed runs in a row and ok again after one success; status is ok, deposit_only, withdraw_only, unavailable or unknown. Use it to warn users before they bridge into a chain they can't currently leave (deposit_only), or to hide unavailable chains, as the LayerHop swap app does. Quotes to every listed chain are still attempted.
{ "id": 14, "slug": "flare", "name": "Flare", "routeHealth": { "in": "ok", "out": "failing", "status": "deposit_only", "checkedAt": "2026-10-23T06:00:00.000Z" } }Use the id or the slug anywhere a chain is expected. Supported chains & tokens lists the current snapshot.
How do I search tokens?#
GET /v1/tokens lists and searches one chain's tokens. It merges LI.FI's token list (with prices), Jupiter's verified list on Solana and LayerHop's curated tokens.
| Param | Required | Meaning |
|---|---|---|
chain |
Yes, unless chains is set |
Chain id or slug |
chains |
No | Up to 20 chain ids or slugs, comma-separated, to search at once instead of chain |
q |
No | Symbol or name, or an exact address / mint |
limit |
No | 1–200, default 50. With chains: per chain, 1–50, default 20 |
cursor |
No | nextCursor from the previous page (not with chains) |
const { tokens, nextCursor } = await lh.tokens({ chain: "berachain", q: "HONEY", limit: 20 });Results rank exact symbol matches first, then popular tokens (native coin, stablecoins, wrapped native, majors), then verified ones, then by liquidity. Page with cursor: nextCursor until nextCursor is null.
How do I search every chain at once?#
Pass chains instead of chain, for example for an "All chains" view in a token picker. One request returns the first page of each chain, at most limit tokens per chain, in the order you listed the chains. There is no paging (nextCursor is always null).
curl "https://api.layerhop.com/v1/tokens?chains=1,8453,42161,7565164&q=usdc&limit=10"With an address or mint as q, you get the listed token on the chains that have it. For an unlisted address, call GET /v1/tokens/lookup without chain.
Search after a pause in typing (about 300 ms) rather than on every keystroke, and don't retry a 429. Without an API key, token searches have their own limit of 120 requests per minute per IP, separate from the 60 per minute for other calls.
What about tokens that are too new for the lists?#
The lists refresh hourly, but a token launched yesterday on a smaller chain is often on none of them yet. GET /v1/tokens still finds it:
- By address. When
qis an address or mint that no list has, LayerHop reads it on chain (asGET /v1/tokens/lookupdoes) and returns it as the only result, withverified: false. If the address isn't a token on that chain, you get an empty list, not an error. - By name or symbol. When a text
q(2 characters or more) matches fewer than 5 listed tokens on an EVM chain or Solana, LayerHop also searches live market data: DexScreener, and GeckoTerminal within that chain when DexScreener has nothing there. Up to 5 tokens on the chain whose symbol or name containsq, and whose deepest pool holds at least $10,000, are read on chain and added after the listed matches. They haveverified: false, plus the market'spriceUsdand logo when known. Any EVM token whose list entry has no logo (in search results, lookups and balances) getslogoURIfrom DexScreener or GeckoTerminal when they have one.
const { tokens } = await lh.tokens({ chain: "berachain", q: "KDK" });
// [{ chainId: 80094, address: "0xc0D1aC00A30fA4e30e44AFc7313d6312c87E21dF", symbol: "KDK", name: "Kodiak", decimals: 18, priceUsd: 0.084, verified: false, … }]Live results are cached for 60 seconds. If the market sources are slow, down or busy, you get the listed matches only, never an error. Treat every verified: false token as unverified: anyone can launch a token with any name, so show a warning before a user trades it.
Each chain has at most one popular token per symbol, the canonical one. On Avalanche, for example, USDC is Circle's native USDC; the bridged USDC.e is popular under its own symbol, and look-alikes stay in the list without popular. A popular token's symbol also works as srcToken / dstToken in quotes on that chain (srcChain=avalanche&srcToken=USDC).
How do I handle a token that is on no list?#
A pasted address that no list knows can still be traded. Read it with GET /v1/tokens/lookup:
const token = await lh.lookupToken("base", "0x…");
if (!token.verified) showWarning(`${token.symbol} is not on any token list. Check the address.`);Unknown EVM tokens are read on chain (symbol, name, decimals). Unknown Solana mints get their decimals from the mint account and their name from Jupiter. Both come back with verified: false, and with priceUsd when a price source knows the token.
What if I don't know the chain?#
Leave chain out. A Solana mint is read on Solana. For an EVM address, LayerHop asks DexScreener which supported chains have pools for it and reads it on the one with the most liquidity (or, if no pools are found, on a chain whose token list has it). An address with no pools on any supported chain answers UNSUPPORTED_TOKEN; pass chain to read it on a specific chain. This is what the LayerHop swap app does when you paste an address with "All chains" selected.
const token = await lh.lookupToken("0xB8CD0b8E056A91c00FD388EdDb37E6E445844B21");
// { chainId: 80094, symbol: "COMPUTE.r", decimals: 18, verified: false, … }curl "https://api.layerhop.com/v1/tokens/lookup?address=0xB8CD0b8E056A91c00FD388EdDb37E6E445844B21"How do I check a token for risks before a user buys it?#
Call GET /v1/tokens/{chain}/{address}/risk before a user buys or receives a token that is not a major. It returns a short report with a level and the reasons behind it:
curl "https://api.layerhop.com/v1/tokens/base/0x532f27101965dd16442E59d40670FaF5eBB142E4/risk"{
"risk": {
"chainId": 8453, "address": "0x1111111111111111111111111111111111111111", "symbol": "USDC",
"level": "danger", "verified": false, "source": "goplus", "checkedAt": "2026-10-27T09:00:00.000Z",
"reasons": [
{ "code": "fake_symbol", "level": "danger", "message": "Calls itself USDC, but it isn't the USDC most people mean on Base." },
{ "code": "sell_tax", "level": "danger", "value": 25, "message": "25% is taken on every sell." }
]
}
}level |
Meaning | What the LayerHop app does |
|---|---|---|
ok |
No issues found in a full report (including a honeypot test), or a major LayerHop lists itself (verified: true) |
Nothing |
caution |
Something to know: a small tax, a tax the owner can change (tax_modifiable, also per wallet), an owner who can mint, pause or blacklist, an upgradeable or unpublished contract, a contract that can self-destruct (selfdestruct) or calls an owner-controlled contract on transfers (external_call), very few holders, no trading data (no_trading_data: buying and selling couldn't be tested, or no market was found). Solana: a creator who can still change the transfer fee, add a transfer hook, make new accounts start frozen, or close the mint (closable) |
Shows the reasons in the swap review |
danger |
Likely to lose money: a honeypot, holders can't sell, a tax of 10% or more, an owner who can change balances, a hidden owner, an airdrop scam (airdrop_scam), a token imitating another one (fake_token), or a fake major |
Shows the reasons and asks for an explicit confirmation |
unknown |
No report right now (the source is down, slow, busy, or doesn't cover the chain) | Says the check is unavailable; never blocks |
- Fake majors. A token whose symbol is a major's (USDC, USDT, ETH, WETH, WBTC, SOL, BNB, …) but whose address is not the real one on that chain gets
fake_symbol, even when the source finds nothing else. It isdanger, orcautionfor a variant a provider token list verifies (such as a bridged copy). - Source. GoPlus Security's token API (EVM chains and Solana), normalized to these codes; the fake-major check is LayerHop's own. Majors LayerHop lists itself are answered without an upstream call.
- Caching and limits. Reports are cached for 10 minutes (
unknownfor 1 minute). 60 requests per minute per key or IP. Anunknownanswer is still a 200, so a failed check never fails your flow. - Checks flag common traps; they can't prove a token is safe.
Can I quote any token?#
Yes. GET /v1/quote accepts any chain from /v1/chains and any token address or mint. Symbols work as shortcuts for the curated tokens (USDC) and for each chain's native coin (ETH, BERA, SOL):
const { best } = await lh.quote({
srcChain: "base", srcToken: "USDC", amount: "10000000", // 10 USDC
dstChain: "berachain", dstToken: "BERA",
sender: evmAddress, recipient: evmAddress,
});Each provider decides support from its own chain list, so quotes contains every provider that serves the pair. A symbol that is not on the curated list returns UNSUPPORTED_TOKEN; pass the address instead.
How do I get USD prices?#
GET /v1/prices takes ids, a comma-separated list of up to 100 chainId:address entries. Prices come from LI.FI for EVM chains and Jupiter for Solana, cached for 60 seconds. When a popular stablecoin's price is more than 0.3% away from $1, LayerHop checks it against DefiLlama and returns the value closer to $1. Prices are never pinned, so a depeg that both sources report still shows. The response is keyed by the ids exactly as you sent them; ids without a price are left out.
const prices = await lh.prices([
"8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
{ chainId: 7565164, address: "So11111111111111111111111111111111111111112" },
]);
// { "8453:0x8335…2913": <usd>, "7565164:So11…112": <usd> }: keys as sent, values are USD numbersHow do I read a wallet's balances?#
GET /v1/balances returns a wallet's non-zero balances with token metadata, priceUsd and valueUsd, highest value first, plus totalUsd.
| Param | Required | Meaning |
|---|---|---|
address |
Yes | An EVM address or a Solana address |
chains |
No | Comma-separated ids or slugs. Default: the popular chains of the address's VM |
tokens |
No | Comma-separated chainId:address (at most 20) that are always returned, even at zero and even when not on any token list. Their chains are scanned too. A bad entry is skipped and listed in errors |
fresh |
No | 1 reloads balances cached more than 4 seconds ago (the result refreshes the cache). At most 20 per minute per key or IP; over that you get the cached result |
const { balances, totalUsd, errors } = await lh.balances("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", ["base", "arbitrum", "berachain"]);- EVM chains report the native coin plus the top 200 popular and verified tokens of each chain (one Multicall3 read per chain). Solana reports SOL and every token account.
- A chain that fails or times out is listed in
errors; the other chains are still returned. - Results are cached for 20 seconds per address and chain. Amounts are integer strings in base units.
How do I show the balance of a token that is not in the list?#
Name it in tokens. The scan only covers each chain's top 200 tokens, so a token a user pasted by address would otherwise be missing, and missing is not the same as zero. A requested token is always in balances, with amount: "0" when the wallet holds none:
- EVM: a token outside the top list gets its own
balanceOf. If it is on no token list, itssymbol,nameanddecimalsare read on-chain and it hasverified: false. - Solana: a mint the wallet does not hold comes back at
"0"with its metadata. - Native coin: pass
0x0000000000000000000000000000000000000000(EVM) orSo11111111111111111111111111111111111111112(Solana). - An address that is not a token (not an ERC-20, not a mint) is listed in
errors; the rest of the response is unaffected. - A malformed entry (unknown chain, a chain of the other VM, an invalid address, or a chain past the 25-chain cap) is skipped and listed in
errors(chainId: 0when the chain is unknown). Only more than 20 entries, or a value with nochainId:addressentry at all, isINVALID_PARAMS.
// A swap form: always show both sides, even for a custom token, and skip the cache after a swap.
const r = await lh.balances(wallet, undefined, {
tokens: ["80094:0x59a61B8d3064A51a95a5D6393c03e2152b1a2770", { chainId: 8453, address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" }],
fresh: true,
});curl "https://api.layerhop.com/v1/balances?address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&tokens=80094:0x59a61B8d3064A51a95a5D6393c03e2152b1a2770&fresh=1"How do I refresh balances after a swap?#
Call again with fresh=1 when the order is submitted and when it fills. A cross-chain destination balance can land a few seconds after filled (and RPC nodes lag slightly), so poll a few more times after that: the LayerHop app refetches at 5, 15 and 30 seconds after the fill. fresh requests count toward the normal rate limit and have their own cap of 20 per minute per key or IP: past it, or within 4 seconds of the last reload, the cached result comes back (never an error).
Last updated