Swap exact out
Swap exact out

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