Switch stSTX <> stSTXbtc
With our swap contract, users can seamlessly exchange between the two STX-based LSTs offered by StackingDAO. Both tokens are backed by the same underlying STX, so a swap simply re-labels one for the other at the current stSTX exchange rate, preserving the underlying STX value. The swap is instant and charges no fee.
The contract can be found here: https://explorer.hiro.so/txid/SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.swap-ststx-ststxbtc-v4?chain=mainnet
Integrations
Integration is simple. There are two methods:
stSTX → stSTXbtc
Call swap-ststx-for-ststxbtc on the SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.swap-ststx-ststxbtc-v4 contract with the following parameters:
ststx-amount- a positive integer value for the ustSTX (micro-stSTX, 10^6) amount you want to swap.min-out- a positive integer for the minimum amount ofstSTXbtcyou are willing to receive; the transaction reverts if the output would be lower (slippage protection). Pass0to accept any amount.
stSTXbtc → stSTX
Call swap-ststxbtc-for-ststx with the following parameters:
ststxbtc-amount- a positive integer value for the ustSTXbtc (micro-stSTXbtc, 10^6) amount you want to swap.min-out- a positive integer for the minimum amount ofstSTXyou are willing to receive; the transaction reverts if the output would be lower (slippage protection). Pass0to accept any amount.
The output amount is derived from the current stSTX exchange rate, read from SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.data-stx-v2 (get-stx-per-ststx). Each swap is bounded by the reserve's available liquidity in that direction; oversized swaps revert.