Tinyman: A DEX on Algorand which makes other DEXs seem tiny

Do repost and rate:

Tinyman is back and this time it is more resilient than ever. Think of it like the Uniswap of Algorand. A decentralized exchange that allows you to exchange ALGO or an Algorand Smart Asset (ASA) for another one. If you are not familiar with the Algorand Ecosystem, checkout the article over

Built on Algorand, tinyman charges fees and takes amount for processing the transactions. Along with being a great a DEX, Tinyman also allows you to buy Algorand on ramp using the Moonpay's service. Tinyman will not charge any fees for using moonpay service on their platform. However, Moonpay charges still apply.

So, the users of tinyman either use it for:

(a) Swapping between tokens

(b) Providing Liquidity

(c) Buying Algorand On Ramp using Moonpay

A brief intro to Swapper and liquidity provider: 

Swapper: The users who swap between various ASA or Algo are charged a miniscule fee (you can say a very Tiny amount) for their swap request. For swapping, they can simply connect their Algorand wallet to the Tinyman platform using WalletConnect and do the swap as per their requirement.

Liquidity Provider: For the swap to complete, there ought to be liquidity in the pool. I will try to boil things down to layman's terms. Essentially, whenever you want to swap between two tokens (say you are swapping ASA "" for another ASA ""). What you want is to sell certain amount of and buying corresponding amount of 

Assume a liquidity pool of pair exists. The liquidity pool will usually contain equal value of both the tokens. So, suppose the token is twice the value of token If there are 50 tokens of in the liquidity pool, then there will be 100 tokens of Now, a liquidity provider is the one who has sent equal amount of both the tokens in the pool. Why would he do that? Well, because he will earn a proportion of fees (which was charged to swapper) from the liquidity pool. The earnings are directly proportional to how much liquidity have you provided compared to total liquidity in the pool.

Consider the hypothetical Example:

  • There exists an ASA named "XYZ".
  • Every XYZ token has a value of 1 ALGO.
  • There exist a Liquidity pool on tinyman where you can swap between XYZ and ALGO.
  • Only I have provided liquidity in the pool which is 100 XYZ and 100 ALGO.

Now, if you want to buy 2 XYZ tokens, you will send 2 Algo + tiny amount of fees over to the tinyman. You will receive 2 XYZ (considering no slippage occurs). Now, the pool will have 102 ALGO and 98 XYZ. And I, as a liquidity provider, has earned the fees that you were charged. So, you are happy because you got the XYZ token and I am happy because I have earned the fees.

So, how does Tinyman do this?

Tinyman charges 0.3% fees for a swap. Along with that, 0.004 ALGO will be charged (not even a penny). The 0.004 ALGO is charged as the DEX has to pay network fees on the Algorand blockchain for the swap to complete.

For every swap, the liquidity provider earns 5/6 of the 0.3% charged to the user (which is 0.25%) and the remaining 1/6 is paid to the Tinyman (0.05%). Now, coming back to our example. Remember that you bought 2 XYZ token? Well, you would have paid the following amounts:

  • 2 ALGO (for the 2 XYZ)
  • 0.006 ALGO (0.3% of 2 ALGO) as the fees for the swap.
  • 0.004 ALGO (the network fees)

Total of 0.01 ALGO is the fees you have paid for the swap. If you have to equate it with the current value of USD, it would be 0.01$. Cannot get tinnier than that!!

This was about swapping. Now coming to the liquidity provider. Remember how I said that I was the only liquidity provider in the pool? So, I will be earning the fees for the swap you have done. The 0.006 ALGO that was charged as a fee to you will be split between me and Tinyman Protocol. I will earn 5/6th (0.005 ALGO) and the remaining 1/6 (0.001 ALGO) goes to the tinyman.

Liquidity Pool Tokens

But in reality, I will not be the only one who has provided liquidity in the pool right? There can be thousands of people providing liquidity in a pool. How will the fees collected be shared?

What tinyman does is this. They create Liquidity Pool Token for every pool. This means there is a liquidity pool token for XYZ-ALGO pool. Before providing liquidity, the provider has to opt-in to the liquidity token. Now, depending on the amount of liquidity you provide, you will be given proportionate amount of liquidity tokens. 

So, in the XYZ-ALGO pool, I was the only liquidity provider. So, if there are 100 LP tokens (1 token for every ALGO-XYZ in the pool), then I will own all of these LP tokens.

What if another person provides liquidity to the pool? Then he will also get corresponding amount of LP tokens. Now, there are two person providing liquidity in the pool (me and this guy). Both of us have certain number of LP tokens. This is how the fees a liquidity provider earn will be calculated:

(Tokens that the person provided / Total LP tokens) * Total Fees Earned by the pool

So, depending on the proportion of LP tokens you have in your account, you will earn the fees. Here's the fun part. You are free to send the LP tokens to another person too. Whoever owns the LP tokens will earn the fees and can remove the corresponding amount of liquidity from the pool if they want to. So, in essence, the LP tokens are also ASA.

Volatility and Slippage Tolerance:

It may happen that the liquidity pool you are trying to swap has the ASA that are very volatile. This means that the corresponding values of the ASA to each other is changing drastically. Maybe the 1 XYZ token is worth 1 ALGO at one instant and 0.5 ALGO at another. So, how will Tinyman, as a DEX, allows you to trade optimally?

To do this, before swapping, you are allowed to modify the "Slippage Tolerance" parameter. So, you set the slippage percentage and agree to receive the minimum amount according to your desire in the worst case. Here's yet another example carrying on with our XYZ-ALGO pool:

Suppose you now want to swap your 2 XYZ token back to the ALGO. But because of low liquidity or maybe high volatility of XYZ, the price is changing rapidly. The price at the time of exchange is exactly 1 ALGO for 1 XYZ (same as initial). You decide that you want to receive atleast 0.95 ALGO for 1 XYZ token. So, you set the slippage tolerance to 5%.

There are two cases:

  • Price slips below 0.95 ALGO: Suppose the price changes to 0.94 ALGO per XYZ. This is below your desired slippage tolerance. So, tinyman will simply revert the transaction and it will fail. You can try later.
  • Price stays above or equal to 0.95 ALGO: Suppose the price stays above 0.95 ALGO per XYZ. In this case, you will receive 0.95 ALGO per XYZ token initially. This is where things get exciting! Say, the price of 1 XYZ token is 1.05 ALGO when your transaction is accepted. In that case too, you will receive 0.95 ALGO per XYZ. But the remaining excess amount 0.1 ALGO per XYZ (1.05 - 0.95) will be the excess amount. This excess amount will be stored in the pool and you can redeem the amount whenever you want in the "Redeem Excess Amount" menu of Tinyman.

Here's the screenshots of when I tried to 3 ALGO for Nexus GP at different slippage percentage.

Swap at 0% slippage: The minimum amount I will receive is same as the current price (6836.25) at the time I sent the transaction.

  • If the price of Nexus GP increases in value relative to ALGO than the number of Nexus per ALGO will decrease (less than 6836.25). Since slippage is 0%, the transaction will fail.
  • If the price of Nexus remains same relative to ALGO then I will receive the same number of token as I set initially.
  • If the price of Nexus decreases relative to ALGO then the number of Nexus per AlGO will be more than the initial 6836.25 (let us assume it is 7000). In that case I will still receive the same 6836.25 Nexus per ALGO. But the remaining Nexus token ((7000 - 6836.25) per ALGO) will remain in the pool that I can redeem whenever I want to.

Swap at 10% slippage: If I swap at 10% slippage, it simply means that I am willing to receive (6836.25 - 610% of the same) per ALGO in worst case. So, if slippage is more than 10% then the transaction fails. But if it is less than 10% then I will receive the minimum amount (10% slippage) and the rest can be redeemed at any time from the "Redeem Excess Amount" menu.

Tinyman v1.1

Beginning of the year was not so good for Tinyman. A Zero-day attack was orchestrated on some of Tinyman's pools by exploiting a vulnerability on its contracts. The goETH and goBTC were removed maliciously from the pools by the attackers. Further attacks on many other pools resulted in draining of many ASA's. As soon as the team was aware about the attack, they spread the words on every platform urging people to remove liquidity from the pools.

A full-scale Bug bounty program was started and Compensation program has been setup to reimburse the people who were affected. The full technical report of the attack can be accessed using this

The immense support this project had over this time has been heart-warming. And of course, they deserve it. The contracts were then update to v1.1 after fixing the bug and then Tinyman v1.1 came into the light. By mid-January, the Tinyman v1.1 was on main-net. 

Do Your Own Research before providing liquidity in any pool. Albeit it is usually a safer option for earning an impressive return, keep in mind Impermanent Loss is not a joke. It is preferred that the tokens in the pool remain at a stable value to each other. In other words, they should be correlated. Rug-pulls ought to be kept in mind too. Be sure to check out the white papers of the ASA (or any token in general) for whom you are providing liquidity. 

Regulation and Society adoption

Ждем новостей

Нет новых страниц

Следующая новость