Skip to Content
LandedFXDocs

Recipes

Copy-ready builds, from a live payout quote to Earn inside your app with your own fee.

Get a free key from the dashboard and set it as LANDEDFX_KEY. Every recipe uses the live API.

Price a payout before you send it

Show your customer what actually lands, at their exact size, across every P2P ad, rail and swap route.

curl -X POST https://api.landedfx.com/api/v1/quotes \
  -H "x-api-key: $LANDEDFX_KEY" \
  -H "content-type: application/json" \
  -d '{ "from": "USDC:base", "to": "NGN", "amount": "100" }'

Use these fields:

FieldShow it as
amountOutWhat lands, after every cost
allInBpsThe total cost against the mid-market rate. See All-in cost
route.summaryThe route in one line
route.stepsEach step, to execute yourself or hand to your treasury team
alternativesOther routes to compare
confidenceHow far to trust the price. See Confidence
expiresAtWhen to fetch a new quote

A quote is a price, not a trade: LandedFX doesn't move the money on these routes.

Offer Earn in your app, with your own fee

Your user deposits USDC from their own wallet into the vault, and you earn up to 1% of the deposit. LandedFX never holds the money, and the fee goes straight from your user's wallet to yours in the same confirmation.

const res = await fetch('https://api.landedfx.com/api/v1/vaults/dollar/transactions', {
  method: 'POST',
  headers: { 'x-api-key': process.env.LANDEDFX_KEY!, 'content-type': 'application/json' },
  body: JSON.stringify({
    action: 'deposit',
    account: userWallet,
    amount: '1000',
    integratorFee: { bps: 50, recipient: yourBaseAddress }, // 0.5%; the most is 100, which is 1%
  }),
});
const { data } = await res.json();

// data.preview: { assets: 995, paid: 1000, fees: { integrator: { amount: 5, ... } } }
// Show that before they confirm, then have their wallet send data.calls in order.

amount is what leaves the user's wallet, and your fee comes out of it. At 50 bps on 1,000 USDC, you receive 5 and 995 goes into the vault.

  • Smart wallets can send all the calls as one transaction, so it's one tap.
  • Regular wallets send them one at a time, waiting for each.
  • Use your own server: the API key must stay out of the browser.

Tell your users about the fee and that the yield can change. See Vaults for what the vault guarantees, and Fees for everything LandedFX charges.

Accept deposits from any chain

The user holds USDT on Tron or USDC on Solana, not USDC on Base. One transaction on their chain swaps, bridges and deposits.

curl -X POST https://api.landedfx.com/api/v1/vaults/dollar/deposit-routes \
  -H "x-api-key: $LANDEDFX_KEY" \
  -H "content-type: application/json" \
  -d '{ "from": "USDT:tron", "account": "TUserTronAddress", "receiver": "0xUserBaseWallet", "amount": "250",
        "integratorFee": { "bps": 50, "recipient": "0xYourBaseAddress" } }'
  • amount is what lands in the vault here, and pay is what it costs in the user's token. So your fee goes on top, unlike the recipe above.
  • Show pay and feesUsd, then have the user sign steps in order on the origin chain.
  • from can be ETH:eth, ETH:base, USDT:tron, USDT:bsc, USDT:eth, USDT:sol, USDC:base, USDC:eth, USDC:arb, USDC:sol or cNGN:base.
  • A non-EVM account needs receiver: the user's wallet on Base.

Show a user's balance as it grows

curl https://api.landedfx.com/api/v1/vaults/dollar/accounts/0xUserWallet

value is what the position is worth now, earned is the gain so far, canWithdrawNow is what can come out at once, and apyPct is the current rate. To withdraw, call /transactions with "action": "withdraw" and an amount, or "action": "redeem" and "amount": "max" for everything.

Know when money moves

Stop polling. Add a webhook for vault.deposit and vault.withdraw, and update your ledger when the event arrives. An endpoint receives every wallet's events, which are public on-chain anyway, so match data.wallet against your own users. Verify every signature.

Let an agent pay per call

An agent with a Base wallet and no API key can pay $0.01 in USDC for a quote. See Build with AI for the code, and to connect Claude, Cursor or ChatGPT to the API.

On this page