Get amount out

Get amount out on ElfomoFi

Base
Base

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

elfomofi
math
3actions
  1. 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. 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. 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.

Get amount received for to
Calculate times divided by rounded
Swap for at least
  • Swap WETH for USDC on Elfomo Fi

    elfomofi
    math

More on ElfomoFi · 2

On other protocols · 2