Swap

Swap on Aero

Base
Base

Acts onchain

Swaps an exact amount of one token for the other through an Aero pool. The socket approves the Metarouter and executes its exact-in swap command against the one pool: the Metarouter pulls the input from the socket, prices it on the pool's reserves at the fee the pool charges right now, pays the output to the socket, and reverts if that is less than the min_out floor. The action returns the amount received. Reach for it to trade a pair on a chosen Aero pool, 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.

More on Aero · 10

On other protocols · 4