> For the complete documentation index, see [llms.txt](https://docs.stackingdao.com/stackingdao/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackingdao.com/stackingdao/core-contracts/switch-ststx-less-than-greater-than-ststxbtc.md).

# 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>

{% hint style="info" %}
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.
{% endhint %}

## Integrations

Integration is simple. There are two methods:

{% stepper %}
{% step %}

## 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.
  {% endstep %}

{% step %}

## 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.
  {% endstep %}
  {% endstepper %}

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.
