Swap

Swap on ElfomoFi

Base
Base

Acts onchain

Swaps an exact amount of one token for another at ElfomoFi's market-maker quote. The socket approves the venue and calls swap with the min_out floor: the venue prices the input at the quote its market maker keeps on chain, reverts if that pays less than the floor, and the action returns the amount received. Reach for it to take a tokenized stock, a major or a stablecoin at a quoted price in one step, coiling the received amount into whatever comes next.

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 · 4