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.
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#
- Quote —
GET /v1/quotewith the source and destination chain, token, amount and addresses. You getbest, all otherquotes, and any per-providererrors. - Build —
POST /v1/orderswith thequoteId. You get a transaction: anEvmTx(maybe with an approval) or a base64 SolanaSvmTx. - Sign — the user's wallet signs. EVM transactions and most Solana transactions are broadcast by the wallet. Solana transactions with
submitViaApi: truego back throughPOST /v1/orders/submit. - Track — poll
GET /v1/orders/{provider}/{id}until the order isfilled,refundedorfailed. See Order tracking.
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#
- New here? Follow the Quickstart.
- Building a backend or a non-TypeScript client? Go to the API reference.
- Want a swap UI without writing one? See Embed the widget and Deep links.
- Using an AI assistant? Point it at
/llms.txtor/llms-full.txt, or use Copy page as Markdown on any page.
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.comand 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.