

Reads onchain state
Reads the amount ElfomoFi would pay right now for an exact input. The venue answers from the quote its market maker keeps on chain for the pair, priced for the account that would make the swap, and answers zero for a pair it does not quote. Reach for it to set a swap floor from a live quote with a slippage haircut, to compare the venue against a routed swap, or to gate a trade on a minimum rate with a predicate.
Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.
Swap WETH for USDC on Elfomo Fi


1·Get amount out
Reads ElfomoFi's current output for exactly 0.001 WETH swapped to USDC, capturing the live quote into slot 0.0.
2·Multiply then divide
Taking that quoted amount, this step multiplies it by 995 and divides by 1000, rounding down, to set a floor below the raw quote.
3·Swap
Finally, the swap sends 0.001 WETH to ElfomoFi and requires at least the floored amount of USDC computed in the prior step, reverting if the return falls short.
More on ElfomoFi · 2
On other protocols · 2