Swap exact out

Swap exact out on Spark PSM

Base
Base

Acts onchain

Buys an exact amount of one Spark PSM asset with another at the PSM's fixed conversion. The socket approves the PSM for max_in and calls swapExactOut: the PSM works out the input the exact output costs at par or at the live savings rate, rounding in its own favor, reverts if that is more than max_in, and the action returns the amount actually spent. Reach for it when a following step needs a precise amount of cash, dollars or the savings token, such as an exact repayment, rather than whatever a fixed input happens to buy.

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 Spark PSM · 3