How to Use the ButtonSwap & Yield Optimizer (Guide)

Secret Network
8 min readApr 13, 2022

ButtonSwap is the first DEX aggregator built on Secret Network that combines liquidity from the decentralized protocols SecretSwap and SiennaSwap in order to find the best swap rates and paths for swapping Secret Tokens.

Behind the scenes it simulates hundreds of thousands of possible swap paths and double checks them live via the liquidity pool smart contracts involved.

On top of offering the best rates, ButtonSwap minimizes any risk by letting the user select slippage tolerance and by being 100% front running and MEV resistant thanks to Secret Network’s private by default blockchain.

The Button Yield Optimizer is one of the many features by Btn.group built to optimize yield on Secret LP tokens from the decentralized protocol SecretSwap by compounding rewards for you.

The protocol automatically sells your earned SEFI and grows the LP position instead.

(NOTE: Unlike Secret Tokens, some Btn.group contracts are not private by design and as a result transactions could theoretically still be linked to your account (learn how to fully preserve your privacy on btn.group apps here).

Purpose?

This step by step guide is intended to educate users on how to:

  • trade secret tokens on ButtonSwap
  • maximize Secret LP staking rewards with the Button Yield Optimizer
  • withdraw Secret LP tokens from Button Pools

Pre-requisites?

  • Install Keplr wallet, an open-source browser extension wallet for the Cosmos interchain ecosystem here
  • Own some SCRT to be used as gas fees (1 SCRT should be enough)
  • Own Secret Tokens (sSCRT, sETH/ERC-20s, sBNB/BEP20s, sXMR, SHD etc.) by swapping on ButtonSwap, wrapping them here or migrating them across Secret Bridges( follow [this guide] to learn how to use bridges)

Connecting wallet

in order to interact with the platform you first need to connect your Keplr wallet in two simple steps:

  1. Navigate to the ButtonSwap application here
  2. click “Connect Wallet” on the top right corner and unlock your account

Making a Swap

you can exchange Secret Tokens by making a swap on the ButtonSwap interface following these simple steps:

  1. Navigate to the ButtonSwap application here
  2. Click on the drop-down menu and select the Secret Token pairing that you would like to swap from the list. (NOTE: native SCRT can also be used but the transaction won’t be fully private)

3. Input the amount that you would like to trade. Use the arrow to flip between the two Secret Tokens (The top token is the one you are selling and the bottom token is the one you are exchanging for)

4. Click on the gear icon to set the slippage tolerance (minimum acceptable amount).

Slippage happens when there is a minor difference between the expected trade ratio and the actual execution price. ButtonSwap lets the trader set the maximum amount of slippage that he tolerates (default is 0.5%).

If the slippage is expected higher the trade won’t execute.

5. Wait a few seconds while ButtonSwap finds the best swap rates and paths for your tokens and view the results on the section below.

You can see that the protocol choses the cheapest and fastest option overall.

6. Once you have confirmed the Secret Token amount you want to trade and slippage tolerance, click “Swap”.

This will prompt a Keplr tab where you can select the gas fees and see the swap details.

7. Since Secret Tokens are private by default, you will need to have a viewing key in order to see your token’s balance.

The same viewing key can be used multiple times for a specific token but If you have traded for a Secret Token that you have not previously owned you will have to unlock a new one in a one-time transaction.

Click View Balance next to the 🔍 icon on the swap menu.

This will prompt a Keplr tab where you can select the gas fees and see the swap details.

You might need to refresh the page or delete browser cookies if you see the “wrong viewing key” error message(NOTE: submitting the transaction again will remove the previous viewing key).

Find more about viewing keys and permits here [viewing keys vs permits article]).

Feel free to reach out to the Secret Support Team at linktr.ee/SCRTSupport for any issue you may encounter along the way.

There are 3 types of minor fees involved with trading on ButtonSwap:

  • Commissions: charged only if ButtonSwap offers the best-aggregated swap rate. They are calculated on the difference between btn.group’s best offer and the other protocols’ best offer. So if another protocol offers the best swap path, there are no fees besides the gas.
  • Trading fees: only applied when other protocols do not offer a swap path.
  • Gas fees: needed to execute the contracts of the DEXs that are involved with the swap.

ButtonSwap offers 6 VIP levels to reward BUTT token holders by lowering the overall commissions and trading fees following the table below (from around 800$ to 12000$ at the time of writing).

The highest VIP level also grants access to swap paths analytics.

BUTT is the utility token of Btn.group needed to interact with various features on the platform including Address Alias, Block Locker, Password Manager. (NOTE: the only way to mint new tokens is by providing liquidity for BUTT and wBTC)

Learn more about BUTT tokenomics here

Buy BUTT tokens directly from ButtonSwap, SecretSwap or SiennaSwap

Optimizing Yield

you can automatically maximize the yield from Secret LP Tokens staking by depositing them into Button Pools.

However before moving on to try it yourself you should understand the risks involved with doing so.

An LP token is sort of a receipt which certifies that you own a specific amount of the underlying pair. By depositing your LP token into the Button Pools this receipt gets in different hands that you need to trust on top of SecretSwap.

We, as Secret Network, trust Btn.group but you should always make your considerations regarding security risks.

On top of this, something you may want to consider is that Button sells SEFI rewards at market price so you can’t trade them based on the price you deem good.

Once you are ready follow these simple steps:

  1. Own an LP token. Follow this guide to buy one on SecretSwap
  2. Navigate to the “Pools” tab from the drop-down menu or by clicking here
  3. On the left you will find a section to filter pools by type and current state, for the scope of this guide I suggest selecting only the incentivized “Yield Optimizer” pools

4. Once you find the right pool enter the token amount and click “Deposit

(NOTE: if you don’t see the right balance of Secret LP tokens you most likely need to create a viewing key for that specific token; you can do so by clicking the “view” button)

This will prompt a Keplr tab where you can select the gas fees and see the swap details.

Feel free to reach out to the Secret Support Team at linktr.ee/SCRTSupport for any issue you may encounter along the way.

Congratulations! you have successfully deposited your Secret LP token in the Button Yield Optimizer pool.

Now, every time someone interacts with the contract, your LP position will automatically grow in size.

(NOTE: 5% of yield from the optimizer is used to reward BUTT stakers)

Withdrawing from Pools

In case you no longer want to maximize your yield with the Button Yield Optimizer

you can easily withdraw your Secret LP token without any unbonding period by following these simple steps:

  1. Navigate to the “Pools” tab from the drop-down menu or by clicking here
  2. Once you find the right pool enter the token amount and click “Withdraw

(NOTE: if you don’t see the right balance of Secret LP tokens you most likely need to create a viewing key for that specific token; you can do so by clicking the “view” button).

This will prompt a Keplr tab where you can select the gas fees and see the swap details. (NOTE: If you are trying to input 100% and receiving an error, try putting a little less 99.99% as you may be encountering a rounding issue)

Feel free to reach out to the Secret Support Team at linktr.ee/SCRTSupport for any issue you may encounter along the way.

You have successfully withdrawn your Secret LP token from the Button Yield Optimizer pool and you should be able to see it in your Keplr wallet on the “Secret Network” section.

If you want to exchange your Secret LP token for the underlying pair you can do so on SecretSwap by following this guide)

What’s Next?

Hopefully you now have a better understanding on how to swap and optimize yield using the Btn.group decentralized applications.

The Button team is working to build the most complete Secret Defi hub and have already announced upcoming updates to the VIP perks.

You can stay up to date with their daily improvements and announcements by joining their community here (latest improvements are listed on the #activity-log channel).

See Btn.group’s future plans: btn.group/roadmap

Follow Btn.group on twitter: twitter.com/BtnGroup

Learn more about the Secret Network ecosystem: scrt.network

Contact the Secret Support Team: linktr.ee/SCRTSupport

--

--

Secret Network

The Data Privacy Platform For Web3 — build and use blockchain applications that are both permissionless and privacy-preserving.