Skip to main content
directDeposit is the default way to fund a flow input. When the transaction executes, it moves tokens from the signer’s wallet into the execution proxy: native tokens arrive as the transaction’s msg.value, ERC-20 tokens through transferFrom. For ERC-20 inputs, the signer must first approve the execution proxy; the compile result lists that approval in actions.

Three forms

amount, simAmount and minAmount are decimal strings of base units: '1000000000000000000' is 1 WETH. Sweep spends what the user holds without knowing the amount up front. Composer simulates with simAmount and assumes the signer holds and approved that much. minAmount is a floor the transaction enforces after the pull; it needs a simAmount at or above it. The floor also becomes the input’s committed minimum, which ops such as continuation.settle need. The capped and sweep forms are ERC-20 only; allowNonExact on a native input is rejected. Some tokens credit a wei or two less than the amount sent, such as stETH and Aave aTokens. For these, Composer turns an exact deposit into a capped one with a floor just below amount. To spend tokens already on the execution proxy, use balanceOf.

Example

Swap WETH to USDC, funded either with exactly 1 WETH or with all the WETH the signer holds:
For a sweep, approve the execution proxy for the amount you want it to be able to pull. An unlimited approval lets it pull the signer’s entire balance.