Deep links
Link straight into a prefilled LayerHop swap with /swap URL parameters (chains, tokens, amount, recipient, ref, integrator), and to the order explorer.
A LayerHop deep link is a https://layerhop.com/swap?… URL that opens the swap app with the chains, tokens, amount and recipient already filled in; the user only connects a wallet and signs. Deep links are a public contract: parameters are only ever added, never changed, and invalid values are ignored instead of causing an error.
Which parameters does /swap accept?#
| Param | Example | Meaning |
|---|---|---|
srcChain |
base |
Chain slug or id. Any of the 71 supported chains. |
srcToken |
USDC |
Symbol from the token list, or address / mint. |
dstChain |
solana |
Chain slug or id. |
dstToken |
SOL |
Symbol or address / mint. |
amount |
100 |
Human units: a decimal string with . as the separator. |
recipient |
9WzD… |
Optional. Prefilled but editable; the app warns when it is not the connected wallet. |
slippageBps |
50 |
Optional. |
ref |
x |
Attribution. ref=bot uses the bot fee channel; any other value uses web. |
integrator |
myapp |
Your partner id, [a-z0-9-]{1,32}. Adds your partner fee when the id belongs to an active partner; attribution only otherwise. |
r |
0x2222… |
A referrer wallet (EVM or Solana). Recorded on the swaps the visitor makes in the next 30 days; no fee change. See Referral links. |
Important
Unlike the API, deep links take
amountin human units (100= 100 USDC), because people type and read them.
Unknown or invalid parameters are ignored and the app falls back to its defaults, so a bad link never shows an error page.
Can a link use Tron?#
Yes, where Tron is available in the app. srcChain=tron or dstChain=tron (or the chain id 728126428) picks Tron, srcToken / dstToken take TRX, USDT or a Tron token's T-address, and recipient takes a T-address when the destination is Tron:
https://layerhop.com/swap?srcChain=tron&srcToken=USDT&dstChain=base&dstToken=USDC&amount=25
https://layerhop.com/swap?srcChain=base&srcToken=ETH&dstChain=tron&dstToken=TRX&amount=0.01The swap card applies the Tron side as soon as the app has loaded its chain list; the user signs with a Tron wallet (TronLink or WalletConnect). The same works on the embed, including allow-lists such as fromChains=tron or fromTokens=tron:USDT and the setParams message. Where Tron isn't available, Tron values are ignored like any unknown chain, so the card opens with its defaults.
What fee does a deep link use?#
| Link | Fee channel | LayerHop fee |
|---|---|---|
/swap?… (any ref other than bot, or none) |
web |
0.15% |
/swap?…&ref=bot |
bot |
0.45% |
/embed?… (the widget) |
widget |
0.15% |
A partner fee from integrator is added on top. See Fees & channels.
1. Build the link#
https://layerhop.com/swap?srcChain=base&srcToken=USDC&dstChain=solana&dstToken=SOL&amount=100
https://layerhop.com/swap?srcChain=solana&srcToken=SOL&dstChain=arbitrum&dstToken=USDC&amount=2.5&slippageBps=100
https://layerhop.com/swap?dstChain=base&dstToken=USDC&recipient=0xYourAddress&ref=newsletter&integrator=myappIn code:
const url = new URL("https://layerhop.com/swap");
url.search = new URLSearchParams({
srcChain: "base", srcToken: "USDC", dstChain: "solana", dstToken: "SOL", amount: "100", ref: "docs",
}).toString();The layerhop link command of the CLI prints the same URL from the terminal.
2. Share it#
Put the link anywhere a URL works: a button in your app, a post, an email or a QR code. The user lands on the swap form, connects an EVM or Solana wallet, reviews the live quote and signs in their own wallet. LayerHop never holds funds.
How do I link to an order?#
https://layerhop.com/explorer?provider=relay&tx=0x… opens the order explorer. Both parameters are optional. Without them the page shows a lookup form; with both, it shows the order's status, the same data as GET /v1/orders/{provider}/{id}. The Telegram bot uses these links after a swap.
Last updated