LayerHopdocs

Guides

Earn fees as a partner

Add your own partner fee on top of LayerHop's when you embed the widget, link to /swap or call the API — how to get listed, caps and payouts.

Open in ClaudeOpen in ChatGPT

Wallets, apps and sites that send swaps through LayerHop can earn their own fee on every trade. Your fee is added on top of LayerHop's fee, shown to the user as a separate line, and paid out to your wallet.

How it works#

Each liquidity provider (Relay, deBridge, Jupiter, 0x, …) accepts only one fee recipient per trade. So LayerHop requests the combined fee (LayerHop's + yours) from the provider, collects it into LayerHop's fee wallets, records your share in a partner ledger, and pays it out to you periodically.

Every quote shows both parts separately:

JSON
"fees": { "ourFeeBps": 30, "integratorFeeBps": 20, "integrator": "myapp" }
  • ourFeeBps is LayerHop's part and integratorFeeBps is yours, both in bps of the input amount.
  • dstAmount already accounts for both.
  • If the provider couldn't apply a fee on that route, both parts are 0. If it applied less than requested (a provider cap), the applied fee is split pro rata.

The widget and the web app show your fee as its own line: Partner fee (myapp) 0.20%.

Get listed#

Partner fees are opt-in and set up by LayerHop. Contact us with:

  1. A partner id: lowercase [a-z0-9-]{1,32}, e.g. myapp. This is the integrator value you already use on the embed.
  2. Your fee in bps, and the highest fee you may want to set per request (maxFeeBps).
  3. Payout addresses: an EVM address and/or a Solana address.
  4. Whether you call the API from a server and want an API key.

Until your id is registered, integrator stays attribution-only. Unknown ids are ignored, so nothing breaks.

Select your partner fee#

There are two ways to select your partner fee.

Public label: integrator#

Use this for the embed, /swap deep links and browser apps:

HTML
<iframe src="https://layerhop.com/embed?dstChain=base&dstToken=USDC&integrator=myapp"></iframe>
Text
https://layerhop.com/swap?srcChain=base&dstChain=solana&dstToken=SOL&integrator=myapp
TypeScript
const lh = new LayerHop({ integrator: "myapp" });

The label is public, so anyone could copy it. Copying it only sends you fees. With a label, your configured fee always applies: integratorFeeBps is ignored.

API key: x-api-key#

Use this for server-side integrations. A partner API key selects your partner and wins over any integrator label. It also lets you choose a fee per request with integratorFeeBps, from 0 up to your maxFeeBps:

TypeScript
const lh = new LayerHop({ apiKey: process.env.LAYERHOP_API_KEY, integratorFeeBps: 50 });
Terminal
curl -H "x-api-key: $LAYERHOP_API_KEY" \
  "https://api.layerhop.com/v1/quote?srcChain=base&srcToken=USDC&amount=100000000&dstChain=solana&dstToken=SOL&sender=0x…&recipient=…&integratorFeeBps=50"

A value above your maxFeeBps returns INVALID_PARAMS. Keep the key on your server. Never ship it to browsers.

Caps#

  • Total cap: LayerHop's fee + your fee is capped at 150 bps (1.50%) by default. When the sum would go over the cap, your part is trimmed to fit. LayerHop's part is never trimmed.
  • Example: the bot channel is 90 bps, so a partner on that channel can earn up to 60 bps.
  • Provider limits: some providers can't carry every fee (see Fees & channels). The quote always shows what was actually applied.

Payouts#

  • The ledger records each order built through LayerHop with your partner fee (POST /v1/orders), and links it to its transaction hash when it is submitted through the API.
  • Your share is estimated in the input token's base units: amount × integratorFeeBps / 10000.
  • Payouts are made manually and periodically, in the tokens the fees were collected in, to your payout addresses.
  • Before each payout, ledger entries are checked against the order status. Orders that were built but never signed, or that were refunded, earn nothing.

Coming soon

a partner dashboard with live earnings, and automated payouts.