LayerHopdocs

Resources

FAQ

Answers to common questions about LayerHop fees, custody, amounts, chain ids, testnets, quote expiry and order status.

Open in ClaudeOpen in ChatGPT

Does LayerHop hold my users' funds?#

No. The user's wallet signs and sends transactions directly to the provider's contracts. LayerHop never receives funds or keys. See Non-custodial model.

How much does LayerHop charge?#

20 bps for API/SDK integrations by default (30 bps on the web app and widget, 90 bps in the Telegram bot), shown on every quote as fees.ourFeeBps. Some routes carry less or none — for example Jupiter routes below its 50 bps minimum. See Fees & channels.

Why are amounts strings?#

Token amounts exceed the safe range of JavaScript numbers (1 ETH is 1000000000000000000 wei). Every amount in the API is an integer string in base units. Convert with the token's decimals: 100 USDC → "100000000". Use BigInt for math.

What is chain id 7565164?#

Solana has no EVM-style chain id, so LayerHop uses 7565164 as Solana's internal id. You can always pass the slug solana instead. See Supported chains.

Do I need an API key?#

Not today. The SDK can send one (x-api-key) but the API does not enforce keys or rate limits yet.

Coming soon

API keys from a developer dashboard, with per-key usage and limits.

Is there a testnet?#

Coming soon

testnet support (Sepolia, Base Sepolia, Arbitrum Sepolia, Solana Devnet). The providers LayerHop aggregates quote mainnet only. For development, run the API locally with LAYERHOP_ENABLE_MOCK=1 to get a deterministic mock provider — and never broadcast its dummy transactions.

How do I run the API myself?#

Terminal
pnpm install
cp .env.example .env
pnpm --filter @layerhop/api dev   # http://localhost:8787/v1

Useful variables: PORT, CORS_ORIGINS, PROVIDERS (e.g. relay,debridge), PROVIDER_TIMEOUT_MS, LAYERHOP_ENABLE_MOCK, the FEE_BPS_* channel fees, fee recipients (FEE_RECIPIENT_EVM, FEE_RECIPIENT_SVM, JUPITER_REFERRAL_ACCOUNT) and provider keys (ZEROX_API_KEY is required for 0x; JUPITER_API_KEY, RELAY_API_KEY, LIFI_API_KEY, DEBRIDGE_API_KEY are optional).

Why did I get QUOTE_EXPIRED?#

Quotes live 30–60 seconds, set by the provider. Build the transaction right after the user confirms, and re-quote on a timer while they decide. See Error handling.

Why is the status always "unknown" for my swap?#

Same-chain swaps through Jupiter and 0x settle inside one transaction, so there is nothing for the provider to track. Confirm the transaction on chain instead. For cross-chain providers, unknown right after sending usually means "not indexed yet" — keep polling. See Order tracking.

Why does a cheaper route not win?#

Ranking uses ETA-adjusted output: each minute beyond the first costs 1 bp (max 50 bps). A marginally better but much slower route can lose to a near-instant one. All quotes are returned, so you can still offer the alternative. See Providers & ranking.

Can I swap from Solana with Relay?#

Not yet. Relay is used for EVM-source routes only. Solana → EVM is served by deBridge and LI.FI.

Can I use these docs with an AI assistant?#

Yes. /llms.txt lists every page with a one-line description, and /llms-full.txt contains the whole site as Markdown. Every page also has Copy page as Markdown.

Where do I report a problem?#

Include the requestId from the error body (or the x-request-id header), the endpoint, and the quoteId or transaction hash.