For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

This contract replaces the previous swap-ststx-ststxbtc-v2. The reserve parameter is no longer required — the reserve is resolved internally — and a min-out slippage parameter has been added.

Integrations

Integration is simple. There are two methods:

1

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 of stSTXbtc you are willing to receive; the transaction reverts if the output would be lower (slippage protection). Pass 0 to accept any amount.

2

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 of stSTX you are willing to receive; the transaction reverts if the output would be lower (slippage protection). Pass 0 to 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.