LayerHopdocs

Get started

Hop any token across any layer.

LayerHop is one API and SDK for best-price cross-chain and same-chain swaps. It compares Jupiter, Relay, deBridge, 0x and LI.FI on every trade and never holds your funds.

Open in ClaudeOpen in ChatGPT

What LayerHop does#

LayerHop is a meta-aggregator for token swaps and bridging. You ask for a quote once. LayerHop asks every liquidity provider that can serve the route, in parallel, and ranks the answers by what the user actually receives. You then get a ready-to-sign transaction for the winning route. The user's own wallet signs it and sends it straight to the provider's audited contracts.

  • One integration, five providers. Jupiter, Relay, deBridge, 0x and LI.FI sit behind a single API.
  • EVM and Solana. Ethereum, Arbitrum, Base, Optimism, BNB Chain, Polygon and Solana, in any direction a provider supports. See Supported chains & tokens.
  • Best for the user, not for us. Quotes are ranked by time-adjusted output. What a route pays LayerHop never affects the ranking.
  • Non-custodial. LayerHop never holds funds or keys. See Non-custodial model.
  • Transparent fees. LayerHop's fee is reported separately on every quote as fees.ourFeeBps. See Fees & channels.

How a swap works#

  1. Quote — GET /v1/quote with the source and destination chain, token, amount and addresses. You get best, all other quotes, and any per-provider errors.
  2. Build — POST /v1/orders with the quoteId. You get a transaction: an EvmTx (maybe with an approval) or a base64 Solana SvmTx.
  3. Sign — the user's wallet signs. EVM transactions and most Solana transactions are broadcast by the wallet. Solana transactions with submitViaApi: true go back through POST /v1/orders/submit.
  4. Track — poll GET /v1/orders/{provider}/{id} until the order is filled, refunded or failed. See Order tracking.
TypeScript
import { LayerHop } from "@layerhop/sdk";

const lh = new LayerHop({ baseUrl: "http://localhost:8787" });
const { best } = await lh.quote({
  srcChain: "base", srcToken: "USDC", amount: "100000000", // 100 USDC (6 decimals)
  dstChain: "solana", dstToken: "SOL",
  sender: "0xYourEvmAddress", recipient: "YourSolanaAddress",
});
const tx = await lh.buildTx(best.quoteId);
// sign `tx` with the user's wallet, then:
for await (const s of lh.watch(best.provider, srcTxHash)) console.log(s.state);

Where to start#

Status#

LayerHop is in its first phase: a zero-capital meta-aggregator. What exists today is the REST API (services/api), the TypeScript SDK (@layerhop/sdk), the swap web app and these docs.

Coming soon

a hosted API at api.layerhop.com and the SDK on npm, API keys and rate limits, webhooks, POST /v1/simulate, order history, React hooks (@layerhop/react), Python/Go/Rust SDKs, a CLI with a local devnet, an MCP server, testnet support, and LayerHop's own intent protocol and solver network. Until the hosted API is live, run it locally — the Quickstart shows how.