A Beginner's Guide to Tinyman
Learn what Tinyman is and how to navigate the protocol like a pro!
Disclaimer: This isn’t financial advice! As we say in crypto, don’t trust – VERIFY! Do your own research and don’t ever invest more than you’re willing to lose. Like any DeFi project, Tinyman comes with risks. The project can fail, smart contracts can be hacked, assets could be compromised, users can be exposed to impermanent loss, etc.
Be safe out there and make sure you do enough research before you decide if Tinyman is right for you.
Welcome back to the club, gov!
We’re super excited for this one. We originally planned to release this guide earlier, but we had to put this one on hold due to the hack Tinyman recently experienced (more on this below).
You know we can’t say no to our fellow governors, especially our newbies who are always looking for new ways to make passive income! Speaking of passive income, we’ll not only show you how to make passive income from Liquidity Pools, but also how to stake the Liquidity Pool tokens you receive on Algofi for additional rewards!
Before we dive into the guide, let’s take a step back and review what Tinyman, Decentralized Exchanges, Automated Market Makers, & Liquidity Pools are as well as the risks associated with them. If you feel confident in your knowledge around these topics, please feel free to skip right to the guide below starting with ‘How to Swap on Tinyman’. If not, stick with us as we take you through all these concepts before diving into the guide.
What is Tinyman?
Put simply, Tinyman is a Decentralized Exchange (DEX) that uses the Automated Market Maker (AMM) model similar to Uniswap on Ethereum. Through the Tinyman protocol, users can swap tokens and provide liquidity in liquidity pools. When users swap tokens, they pay a 0.3% fee to the liquidity providers in the respective pool. On the flip side, if users provide liquidity they receive a cut of that 0.3% fee proportioned to their share of the pool.
In addition to the above, Tinyman is gearing up for an exciting 2022 based on their most recent roadmap which includes a governance token, NFTs, and a rewards initiative through the Algorand Foundation’s Aeneas Liquidity Program.
Gov Tip: You can learn more about the Aeneas Liquidity program in the first and second parts of my guide. Be sure to check them out after this one if you haven’t already.
What are liquidity pools and Automated Market Makers?
Liquidity pools (LP) are a pool of tokens locked in a smart contract that are used to facilitate trading by providing liquidity / available funds to users. LPs are used by DEXs as the foundation of their protocols. Without healthy volumes of liquidity, swaps can’t occur since there wouldn’t be enough available assets to make a safe and stable exchange.
The concept of liquidity pools is easy to grasp once it's been explained. The most basic and common LPs hold an equal value between two tokens and are programmed to maintain a constant value. For example, a LP could be created with a balance of 1,000 ALGO and 1,000 STBL. If we assume both assets have an even price of $1, then this would mean the constant value the LP would maintain would be $2,000. If ALGO were to increase to $2, the LP would then recalibrate its balance of assets to maintain this value of $2,000 (likely through the sale of ALGO to arbitrage traders; more on this in the risks section below).
Users who provide liquidity are called liquidity providers, and they receive LP tokens in proportion to the amount of liquidity they have provided to the pool. Liquidity providers can only exit a LP by burning their LP tokens in exchange for their initial investment back. Between receiving and burning their LP tokens, liquidity providers receive a cut of the 0.3% trading fee anytime a trade is facilitated by their pool. As mentioned above, this cut is proportioned to the amount they provided.
When swaps happen within LPs, the price is adjusted based on a deterministic algorithm automatically (which gave birth to the term ‘Automated Market Makers’). To put this in more simplistic terms, the ratio of the tokens within the LP dictates the price. For example, if you swap STBL for ALGO from an ALGO-STBL LP, this would decrease the quantity of ALGO and increase the quantity of STBL. As the supply of ALGO decreases, its price increases and vice versa for STBL. How much the price is affected is based on the size of the trade and pool. The bigger the pool, the less the price impact.
Why do we need liquidity pools and Automated Market Makers?
Liquidity pools are needed to create a decentralized model that doesn’t rely on a centralized order book. This centralized order book model is used on popular exchanges like Coinbase, Binance, and the traditional stock market. Essentially order books match buyers and sellers together based on price.
However, there are inherent issues with the concept of a centralized order book on an exchange including, but not limited to:
If a price can’t be agreed upon then trading could halt.
If centralized exchanges (i.e. Coinbase, Binance, and Robinhood) don’t like the direction the market is going in, they can shut down their platform and trading all together while blaming it on “technical issues”.
The order book model relies on external market makers to help “make the market”. External market makers facilitate trading by always being willing to buy or sell an asset which in turn provides the necessary liquidity to other market participants. However, as you probably already guessed, relying on a central power like this brings other issues:
Market makers constantly change their prices which leads to huge numbers of orders & cancellations
If market makers suddenly halt trading, centralized exchanges can become illiquid and in turn unusable
Liquidity pools and Automated Market Makers allows us to move away from this centralized order book model controlled by external market makers and towards a decentralized system that relies on smart contracts and the market participants themselves.
There is a lot of math and code involved behind the scenes when it comes to liquidity pools and Automated Market Makers. If that sentence sounded interesting to you, we encourage you to continue your research into this subject. The deeper you go, the more fascinating it all becomes!
What are the risks?
Like anything in DeFi, this all comes with risks that you should consider. When it comes to Tinyman, Automated Market Makers, and Liquidity Pools the major risks include, but aren’t limited to:
Smart Contract Failures & Hacks: As we all recently witnessed, smart contracts are prone to attacks and hacks. On 1/1/2022, an attack was orchestrated by hackers on Tinyman and its LPs. By exploiting an unknown vulnerability in the Tinyman smart contracts, the hackers were able to withdraw an amount of assets much greater than their share of the pools. This wasn’t the first time an AMM was attacked and it certainly won’t be the last, so please always consider this as a possibility with your funds and never lend out more than you can afford to lose no matter how tempting the rewards are.
Impermanent Loss: When you provide liquidity to a LP and the price of your deposited assets changes compared to when you deposited them, you can experience impermanent loss. Like mentioned above, the LP is programmed to maintain a constant value between two tokens, so arbitrage traders will use the pool to swap the two tokens until the necessary constant value is achieved.
When you redeem your assets, you will likely receive a different proportion of assets than what you originally provided. For example, if you supplied 100 ALGO and 100 STBL when they were both $1 and then ALGO goes up to $2, you will likely receive 50 ALGO and 100 STBL if you redeem your assets before the prices return to their original amounts. When this happens, you end up with a combined value of assets that is less than if you had simply held them instead of providing liquidity (50 ALGO @ $2 = $100 vs. 100 ALGO @ $2 = $200).
However, these losses can be off-set by the rewards earned from LPs or by providing liquidity to stablecoin pairs due to their low price volatility.
This is an important concept to grasp, and we highly recommend you do a deep dive into impermanent loss before becoming a liquidity provider. We recommend this video and article from Binance Academy as a starting point.
Slippage: Slippage occurs when a trade settles for an average price that is different than what was initially requested, and it often happens when there's not enough liquidity to complete your order or the market is volatile. This leads to the final order price changing. Slippage is typically accounted for through a max allowable slippage percentage. If the slippage is less than expected, users will be provided with excess funds from the LP. Think of these excess funds as an IOU from the LP that you can redeem immediately or at a later date.
As always, we encourage you to do your own research to ensure you fully understand the risks you take on with any protocol! If you’re still interested in using the Tinyman protocol (after assessing your risk tolerance), please proceed with our guide below.
How to Swap on Tinyman
Step 1: Connect Wallet
Disclaimer Before We Begin: When you supply or swap ALGO on platforms like Tinyman, please remember that the asset will be removed from your wallet. This is important for governors who don’t have a separate DeFi wallet from the wallet they used to sign-up for Governance. You can put yourself at risk of being ineligible for Governance rewards if you supply or swap ALGOs you already committed to governance!
First you need to connect your wallet by clicking the button highlighted in the top right:
Step 2A: Choose the Tokens you Want to Swap (Healthy Liquidity)
Tinyman navigates users to the ‘Swap’ section automatically, so once you’ve connected your wallet you should see this menu screen:
Here you can select the tokens you’d like to swap by clicking on ‘Algorand’ if you want to make a swap that doesn’t include ALGO as well as the ‘Select a token, or paste the ID’ button below the ‘To’ prompt.
For the purposes of this guide, we’ll show you how to swap USDC for STBL so we can join the USDC-STBL Liquidity Pool. After we receive our LP Tokens, we can stake them in Algofi to gain an additional ~18% APR (at the time of this writing) paid out in both STBL and ALGO!
First determine how much USDC you’d like to stake because you will need to split that amount 50/50 between USDC & STBL. Once you have that amount, enter the amount of USDC you’d like to swap to STBL:
Click swap to proceed to the finalize swap screen:
Note that Tinyman provides the minimum amount of STBL you will receive no matter the slippage. This pool currently has high liquidity so there aren’t any major slippage concerns for this particular swap.
Once you’re ready, click ‘Confirm Swap’ to proceed to sign the transaction with your wallet and finalize the swap:
You can confirm the final swap amount as well as the transaction ID on this screen. At the bottom, you will be able to redeem the excess STBL tokens the liquidity pool owes you due to slippage. You can redeem these tokens now or at a later date. We personally redeem the tokens right away to keep the transaction as clean as possible for tax purposes.
Congratulations on making your first swap! But all swaps aren’t as easy…
Step 2B: Choose the Tokens you Want to Swap (Low Liquidity)
There will be times when you want to swap two tokens that have low liquidity on Tinyman and other AMMs. For example, say you have extra USDC after swapping to STBL and you want to pick up some DEFLY because that’s what all the cool govs can’t stop talking about.
Because the USDC-DEFLY liquidity pool on Tinyman is low, you will receive this warning message (in red below):
Making this swap would put you at risk of the volatility of price fluctuations and lead to a larger slippage rate. Don’t fear though. You can still get some DEFLY if you take a few additional steps to protect yourself.
First, you will swap your USDC to ALGO due to high liquidity between the pairing:
After completing the swap and redeeming your excess ALGOs, you can now make a swap from ALGO to DEFLY due to the stability of that particular pool (#2 in volume on Tinyman at the time of writing this):
This is a helpful tip to keep in mind whenever you use any AMM and not just Tinyman. If the direct swap you want to make has low liquidity, swap into ALGO first and then you can use your newly swapped ALGO to complete the swap for the token you want. This of course assumes a high liquidity between ALGO and the second token, but very often ALGO pairings have high liquidity.
How to Provide Liquidity
Step 1: Select Liquidity Pool
There are two ways to provide liquidity on Tinyman. If you know the pool you want to add liquidity to, you can select ‘Pool’ from the menu bar. At the ‘Pool’ homescreen, select ‘Add Liquidity’:
If you’re unsure of the pool you’d like to join, you can navigate to the ‘Analytics’ section of Tinyman. You’ll know you’re in the right place if your screen looks like this:
You can now scroll through all the Liquidity Pools and analyze stats based on Total-Value-Locked (TVL), Volume, Fees, and APY:
Once you’re ready to add liquidity to a pool, you can select the plus sign next to that respective pool:
This button works exactly the same as the ‘Add Liquidity’ button from the ‘Pools’ section, except it will automatically populate the pairing you need to supply to enter the pool since you are selecting the pool directly from this screen.
Step 2: Provide Liquidity
If you decide to go through the ‘Pools’ section and the ‘Add Liquidity’ button there, you will need to select your pairing. In our case, we will select both USDC and STBL and put up an equal amount of both based on the latest pricing. This is auto populated by Tinyman once you fill out the amount you’d like to swap for one of the tokens:
Tinyman provides some useful stats for users before they commit to a pool, including the prices / exchange rate between the two tokens as well as the share of pool (& rewards) the user will be entitled to based on how much they have supplied.
You will be prompted to opt-in to the Tinyman Liquidity Pool Token for the respective pool you’re providing liquidity to:
Please note you must opt-in to this asset if you want to add liquidity to the pool. You will use these tokens to redeem your rewards and original investment (when that time comes).
Once you’ve opted-in to the LP Token in your wallet, you can select ‘Add Liquidity’ and you’ll be prompted to sign the transaction:
Once you’ve confirmed all the information on this screen is correct, select ‘Confirm Supply’ and sign the transaction. On the following screen, you’ll receive details around how many LP Tokens you received, the transaction ID, and how many LP Tokens you can redeem from the pool due to slippage:
BONUS: How to stake LP Tokens on Algofi
If you’ve supplied to the USDC-STBL Liquidity Pool, and you’re interested in staking your freshly minted LP Tokens on Algofi to earn an additional ~18% APR (at time of this writing) paid out in both STBL and ALGO, you can continue with the guide below.
Step 1: Navigate to Algofi
Click here to navigate to Algofi.
Step 2: Connect your wallet
First you need to connect your wallet by clicking the button highlighted from the menu bar:
Then navigate to the staking pools, by selecting ‘Staking’ from the menu.
Step 3: Stake in the STBL-USDC-LP-V2 Pool
Click the ‘STBL-USDC-LP-V2’ (make sure to select V2) Pool to reveal the menu for the pool:
From here you can select the ‘Max’ button within the ‘Amount’ section under ‘Stake’ to select all of your Tinyman LP Tokens. Once done click ‘Stake’ to confirm and sign the transaction.
Please note, your LP Tokens will be removed from your wallet during this step and if you want to redeem your stake from the liquidity pool on Tinyman you will first need to unstake your tokens from Algofi.
If you want more information on Tinyman, we highly recommend their official documentation. The FAQ section in particular is pretty all encompassing!
If you found this guide helpful, make sure you don’t miss more helpful content from us by following us on Twitter @AlgoGovClub and subscribing to our newsletter to stay as up to date as possible.
As always, thank you for stopping by the club! Please leave us a comment below or on Twitter to let us know if you have any additional questions and what other guides you’d like to see in the future.
Until next time, gov!