LayerHopDocsLaunch app (opens in a new tab)

Fund apps and earn on stablecoins

One-click deposits into Polymarket, Hyperliquid, Aave or any deposit address from any chain and token, and the best USDC / USDT supply rates across Aave, Compound, Morpho and Spark with user-signed deposits.

Two read-only API groups power app.layerhop.com/fund and app.layerhop.com/earn, and you can use them in your own app. LayerHop never holds the funds: the route is an ordinary quote the user signs, and a vault deposit is a pair of calls the user's own wallet sends. LayerHop doesn't control these apps or protocols, so show each target's risk text before the user signs.

Which apps can a user fund?#

GET /v1/fund/targets lists them, with where the money lands and who receives it:

Target kind Route lands as Recipient
polymarket bridge-address USDC on Polygon the user's Polymarket bridge address (below); min $2
hyperliquid own-account USDC on Hyperliquid (HyperCore, chain 1337) the user's own EVM address
aave-v3-base, aave-v3-arbitrum vault USDC on Base / Arbitrum the user's wallet, then a supply from it
deposit-address custom-address the chain and token the app asks for the address the user pastes

For every target, get a quote from the user's token to dst with recipient set as above, and add purpose=fund if you want the orders tagged.

How does the Polymarket deposit work?#

Polymarket's Bridge API gives every Polymarket wallet its own bridge address, and a deposit to it credits that Polymarket balance. POST /v1/fund/polymarket/address {address} asks Polymarket for it (with your builder code when POLYMARKET_BUILDER_CODE is set) and returns { wallet, evm, svm? }. Quote any token into USDC on Polygon with recipient = evm. The address you send must be the user's own Polymarket wallet (shown in their Polymarket profile), not their connected wallet and never an exchange address. Deposits under $2 are not processed by Polymarket.

What are the current stablecoin rates?#

GET /v1/yields?asset=USDC (or USDT) lists a fixed registry of major vaults, best first: Aave v3, Compound v3, Morpho vaults (Spark USDC, Gauntlet USDC Prime, Steakhouse) and Spark Savings USDC. Aave, Compound and Spark rates are read on-chain; Morpho APYs come from Morpho's API, after the curator fee. Every vault's address and deposit were checked against mainnet state before it was added. Rates are variable and cached for 5 minutes; a vault whose rate can't be read is listed in unavailable.

The app ranks the pools by a year of yield at today's rate for the user's amount, minus the one-off cost of getting there (route fees and gas from the user's largest balance of that stablecoin; nothing when it is already on that chain), so a slightly lower rate on the chain you're on can win for a small amount.

How does a vault deposit work?#

  1. Route to the vault's stablecoin on its chain, paid to the user's own wallet (skip this when it is already there).
  2. POST /v1/yields/{id}/deposit {owner, amount} returns the calls: an exact-amount approve and then supply (Aave v3, to owner), supply (Compound v3) or deposit(amount, owner) (ERC-4626 vaults). The API simulates them from owner with eth_simulateV1 first; a revert is CALLS_REVERTED.
  3. Send the calls from owner. With @layerhop/wagmi, sendWalletCalls puts approve and deposit in one EIP-5792 confirmation where the wallet batches atomically, and sends them one after the other otherwise.

For Aave, oneStep: true on the target means destination calls are live: a POST /v1/quote with action: { type: "aave-v3-supply" } bridges and supplies in one transaction (see destination calls).

Can it move my money when another vault pays more?#

No. Moving funds automatically would need custody. Instead, a rate alert (kind: yield in POST /v1/alerts/drafts) tells the user on Telegram when the best other vault pays at least pct APY points more than theirs, with a link back to app.layerhop.com/earn. Moving is always the user's own click and signature.

Last updated