Moving stablecoin savings into a lending market means transferring tokens to the destination chain and supplying them to a lending pool. The deciding condition is whether the amount that arrives, after route costs and slippage, can be deposited under that market’s current asset and account constraints.
- Quote the whole path to the lending asset, not just the bridge leg.
- Size the deposit against the destination market’s supply cap and the user’s available balance.
- Choose between a separate destination deposit and a composed bridge-and-deposit call based on failure recovery and gas availability.
Model the move as a cross-chain transfer followed by a supply
A cross-chain deposit has at least two state transitions: the source chain locks, burns, or otherwise commits the input, and the destination chain delivers the output; the lending market then accounts for a supply. A route may compose delivery and supply into one destination call, but the bridge and market remain separate systems with separate failure modes.
For a direct USDC supply, compare the destination token’s contract address and chain ID with the reserve asset configured by the market. Matching symbols are not enough: bridged USDC variants can have different issuers, decimals, and risk parameters, and a market may list only one of them.
Think of the route as a courier carrying a precisely weighed package to a warehouse: the quote estimates what reaches the door, while the lending market decides whether it can accept the package. A bridge quote alone does not confirm that the reserve is active, below its supply cap, or callable by the intended account.
Calculate the depositable amount and execution budget
Calculate in base units, then convert for display: a six-decimal USDC amount of 10,000 is 10,000,000,000 units. For an aggregator quote, pass the source amount as an integer string, along with source and destination chain IDs, token addresses, sender, recipient, and an explicit slippage tolerance; a quote response commonly separates estimated output from a minimum output after slippage.
For example, suppose a route estimates 9,985 USDC on the destination and returns a minimum of 9,935 at 0.5% slippage. The estimated amount is useful for previewing the supply, but the minimum is the amount to use when checking whether the transaction remains acceptable if execution reaches the slippage bound. These figures are illustrative; route fees, gas, and output change with liquidity and network conditions.
Budget source-chain gas for approval and transfer, and destination-chain gas if the user must submit a separate supply transaction. A composed call may require the route to reserve destination gas or swap part of the delivered asset into the native gas token. Compare the net amount supplied and completion time; the cheapest route can be slower, while the fastest can consume more value in fees.
Execute these five integration steps
- Validate the destination reserve. Read the market’s current reserve configuration and confirm the asset is enabled for supply, the market is not paused, and any supply cap has headroom. Subtract other deposits if the cap is shared, and account for a user-specific maximum if the protocol enforces one.
- Request and filter routes. Ask for the exact source and destination token pair and the intended recipient. Reject routes whose output token is not the reserve asset, whose minimum output falls below the user’s deposit threshold, or whose required source approval and destination call are outside your supported transaction flow. For this cross-chain leg, fermi swap is relevant when it can route the chosen source asset to the asset accepted by the destination lending market. Treat fermi swap as a route option to validate against the same constraints, not as proof that the deposit itself is supported.
- Set slippage and refresh before signing. For liquid stablecoin routes, an illustrative starting tolerance might be 0.1–0.5%; lower tolerances reduce execution variance but increase revert risk when pools move or liquidity thins. Re-quote if the route expires, its minimum output changes materially, or the user changes the amount. Do not silently widen slippage to rescue a failing quote.
- Obtain source approval and submit the transfer. Use the quote’s spender or approval address, verify it matches the selected route, and approve only the required amount where practical. Exact approvals reduce residual allowance but may add a transaction on a later deposit; unlimited approvals save that transaction at the cost of persistent exposure. Record the source transaction hash and route identifier for tracking.
- Supply only after destination delivery is confirmed. In a two-transaction flow, wait until the destination token is actually credited, then simulate and submit the market’s supply call with the credited amount and intended beneficiary. In a composed flow, confirm the bridge supports the destination call, the call encodes the correct market and beneficiary, and there is a defined recovery path if delivery succeeds but the supply call fails.
Reconcile completion from destination-chain state
A source-chain confirmation is not proof that the lending position exists: cross-chain messaging and settlement are asynchronous, and a route can remain pending after the source transaction finalizes. Track delivery separately from the supply receipt, then verify the destination balance change or the market’s supply event and position balance before marking the savings move complete.
If delivery succeeds but a composed supply reverts, the user may end up holding the stablecoin in the destination wallet and need gas to retry. If a separate supply is used, make the UI state explicit: show the received amount, reserve, beneficiary, and whether the supply transaction is still needed. That distinction is central when integrating fermi swap into a lending workflow, because a successful bridge and a successful deposit are different outcomes.
Top comments (0)