Ripio doesn’t operate LI.FI or the venues it routes through. Swaps execute on third-party protocols at the prices they offer, so the amount received depends on the route LI.FI selects at quote time and can differ from the estimate.
What you can build
Swap wFiat and USDC
Let users move between their local currency and dollars on-chain: wARS to USDC, USDC to wBRL.
Local-to-local FX
Swap one local stablecoin for another in one transaction, for example wARS to wBRL.
Receive wFiat from any chain
The payer sends any token on any chain, and the recipient gets wMXN on Base.
How it works
1
Get a quote
GET /v1/quote returns a route for the pair and amount, the estimated and minimum output, the fees, and a transactionRequest ready to sign.2
Approve the token
If the source token is an ERC-20, the user approves the
approvalAddress from the quote to spend fromAmount.3
Send the transaction
The user signs and sends the
transactionRequest. Same-chain swaps settle in that transaction.4
Track the status
For cross-chain routes, poll
GET /v1/status until the transfer is DONE or FAILED.Token addresses
LI.FI recognizes the wFiat token addresses on Ethereum, Base, World Chain, BNB Smart Chain, Polygon, Gnosis and Celo. Each token uses the same address on every EVM chain, with 18 decimals. See Contracts for the full network list.Recipe
The examples below use the LI.FI REST API with viem, on Base and Arbitrum. The same calls work on any chain above: add it to the client map and change the chain IDs and token addresses. LI.FI quotes run against mainnet and wFiat isn’t deployed on testnets, so test with small amounts.0. Setup
GET /v1/token, never from a symbol alone.
1. Get a quote
quote.ts
toAmount and the fees before the user confirms, and request a new quote if they wait: prices move. A 0.5% slippage is a reasonable starting point for wFiat and USDC pairs; a lower value protects the user more but reverts more often. LI.FI also skips routes above 10% price impact by default (maxPriceImpact).
2. Approve the source token
approve.ts
3. Send the transaction
execute.ts
slippage the transaction reverts and the user keeps the source token, minus the gas paid for the failed transaction: request a new quote and try again.
4. Swap one local stablecoin for another
Local-to-local FX is the same call with two wFiat. For example, wARS to wBRL on Base:5. Receive wFiat from any chain
To let someone pay from another chain and deliver wFiat to a recipient, set a differenttoChain and the recipient as toAddress. For example, a payer sends 50 USDC on Arbitrum and a merchant receives wMXN on Base. executeQuote switches the payer’s wallet to Arbitrum, the source chain, before signing:
status.ts
DONE and FAILED are final. Check substatus on a DONE transfer: COMPLETED means the recipient got the requested token, while PARTIAL or REFUNDED mean they received a different token or the payer got the funds back. Compare receiving.amount with the quote’s toAmountMin. See LI.FI’s status tracking guide.
Moving the same wFiat between chains? Use the Ripio Bridge instead: it burns the token on the source chain and mints it on the destination, with a single contract call.
Embed the LI.FI widget
If you’d rather not build the swap UI, LI.FI’s React widget handles quotes, approvals, execution and status. Preconfigure it with wFiat as the destination, and add the wFiat you want users to pick, since the widget’s default token list doesn’t include every wFiat on every chain:swap-widget.tsx
LI.FI Widget docs
Install the widget and configure chains, tokens, theme and wallet management.
Monetize the integration
Addfee to the quote (for example fee=0.003 for 0.3%) together with your integrator string to take a commission on every swap. The fee is deducted from the source token and appears in feeCosts next to LI.FI’s. Create an integrator account and set the wallet that receives your fees in the LI.FI Partner Portal. See Monetizing the integration.
Rate limits and API key
Without an API key,/quote allows 75 requests per two hours, which is enough to test but not for production. An API key defaults to 100 requests per minute, applied over a two-hour rolling window. Request a key in the Partner Portal and send it as the x-lifi-api-key header from your backend only: never expose it in the browser. A 429 response with error code 1005 means you hit the limit. See LI.FI’s rate limits.
Resources
- LI.FI API reference
- Get a quote and check the status
- LI.FI Widget
- wFiat contracts and networks
- Ripio Bridge developer guide