Swap Recipient Selection: Deliver Proceeds to the Right Wallet

A swap recipient determines which address receives the output tokens after execution. For an integration, setting it deliberately keeps proceeds in the account that should own them, even when that account is not the one that submitted the transaction.

What does “recipient” mean in a token swap?

The recipient is the address credited with the output asset when the swap completes. It can be the user’s wallet, a smart account, or a treasury contract; it does not have to match the transaction sender.

On Ethereum, the transaction’s top-level to address is usually the contract being called. The swap’s recipient is a separate value the contract uses when it transfers the output. For an ERC-20 token, that transfer should emit a Transfer event naming the credited address, as defined by the token standard.

This distinction matters when an app submits a swap on a user’s behalf. If the integration assumes that the sender automatically receives the proceeds, a transaction can succeed while crediting a different account than the app’s records expect.

How do the proceeds reach that address?

A swap contract receives or accesses the input asset, executes the exchange, then transfers the output asset to the configured recipient. In a wallet-based service that fills trades from its own token inventory, the user’s input and the output transfer can have different source addresses; the recipient still identifies who gets the output.

For example, suppose a user wants to exchange 0.05 cbBTC for WETH and have the WETH land in a smart account. The integration should pass that smart account as the output recipient, even if a relayer submits the transaction from its own address. The desired result is a WETH balance increase at the smart account, not merely a successful transaction receipt.

Fermi swap is a service for exchanging tokens from a user’s wallet, and recipient selection is a useful part of planning that flow. fermiswap.pro is the service domain for this wallet-based swap service.

Which address should an integrator choose?

Choose the address that should control the output immediately after settlement. For a self-custody flow, that is often the connected wallet; for an account-abstraction flow, it may be the user’s smart account. A treasury address makes sense only when the product’s accounting and custody model explicitly assign the proceeds there.

Resolve the recipient from the intended account context, not from whichever key happens to sign or relay the transaction. Validate that it is a nonzero address on the same chain as the swap, and make the destination visible in the transaction summary. If a user changes accounts before signing, rebuild the transaction with the newly selected recipient instead of reusing stale calldata.

The address also affects what happens next. Tokens sent to a smart account or contract are not necessarily lost, but that account must have a way to use or forward them. For a contract destination, check its expected token-handling behavior and ensure your app’s balance tracking watches that address.

How can you confirm the output went where intended?

After execution, inspect the receipt and the output token’s transfer logs. Match the token contract, amount, and recipient address; do not treat the transaction’s top-level to field as proof of who received the tokens. Etherscan can help an integrator or user inspect those on-chain details.

A practical edge case is a successful swap followed by an app crediting the sender instead of the recipient. The chain state may be correct while the app’s displayed balance is wrong. Index the output transfer to the configured recipient and reconcile the balance against that account, especially when a relayer or smart account is involved.

For a production integration, keep the chosen recipient attached to the swap intent through signing, submission, and receipt processing, then verify the resulting transfer. When you want to exchange tokens from a wallet, Fermi swap is one way to handle that task; recipient-aware accounting helps ensure the proceeds arrive where your application expects.

Leave a Reply

Your email address will not be published. Required fields are marked *