avatarPerpetual Protocol

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

5472

Abstract

ions happening on our LBP on Balancer and share the transaction info on a private channel to gauge the current market demand.</p><figure id="0039"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*vpptfDj4PnKWcfzU"><figcaption></figcaption></figure><h2 id="7580">(Internal) Simulations on different combinations of starting price, duration, and price impact from orders of different sizes</h2><p id="d020">There are many parameters on an LBP that a project can adjust, such as the duration of the pool, starting weights and the ending weights for both assets, and the amount of the assets stored inside the pool. Since we’re the first project that uses Balancer’s LBP to distribute tokens, we need a way to simulate different scenarios that we might encounter when the pool is live. That’s why the Balancer team and us create <a href="https://docs.google.com/spreadsheets/d/1Zmy8pRz9Kx3zQR1g2XDIDrLf7RF4Jo-tmQonW-ag84w/edit#gid=0">a spreadsheet filled with different combinations of those parameters </a>which help us ultimately decide to go with the plan that you’ve seen in the section above.</p><figure id="961c"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*2lRe_-fX5wgjjdy9"><figcaption>Some of the price charts from the simulations</figcaption></figure><p id="9a88">Despite this thorough preparation, we still underestimate the demand from the market which results in the final ending price being greater than the starting price. We would suggest future projects that adopt LBP as the distribution mechanism to set the starting price higher than what we’ve done to reduce price speculation.</p><h1 id="ae59">🧠 Lessons Learned</h1><h2 id="4e32">LBP can truly prevent frontrunners</h2><p id="d5aa">When our LBP is deployed on the Ethereum mainnet, thanks to the aforementioned HAL bots on our Discord server, we can immediately spot some traders (or bots?) coming in and buying PERP even before our announcement. Below is the tale of a bot (or a trader who didn’t read the warning) getting rekt by the LBP:</p><p id="4eaf">🤔 <a href="https://etherscan.io/tx/0x610f44e0bad480ab1677e50a1194a66cc74ea70b4d0742fa4eb430992e2ee6a2">2020/9/9 05:23:43 AM (UTC)</a> Bot A spent 0.49 ETH as the gas fee to use 25,000 USDC in exchange for 14,009.68 PERP (1.784 USDC/PERP).</p><p id="34a5">😊 <a href="https://etherscan.io/tx/0xc81dddfb149cceb285ee7f5135ce5873bc5cf588ead8dd58a11e7c75f2f0bc3e">2020/9/9 05:34:13 AM (UTC)</a> Bot A’s operator spent 0.015 ETH as the gas fee to use 14,009.68 PERP in exchange for 25,679.34 USDC (1.83 USDC/PERP) and realized a profit of 679.34 USDC.</p><p id="0349">🤞 <a href="https://etherscan.io/tx/0xd4273238cc36023590e6a4ce9c2e5460eff90ec69af0a4f937711638c7eba2ee">2020/9/9 06:01:35 AM (UTC)</a> Bot A’s operator spent 0.015 ETH as the gas fee to use 25,000 USDC for 14,301.65 PERP (1.748 USDC/PERP)</p><p id="c465">😢<a href="https://etherscan.io/tx/0x35a9271d0a39697569b17837b3b5af0442e55e184c9e7a498a5368e2922f63a7">2020/9/9 06:24:13 AM (UTC)</a> Bot A’s operator spent 0.015 ETH as the gas fee to use 14,301.65 PERP for 23,453.155 USDC (1.64 USDC/PERP) and realized a loss of 1546.845 USDC.</p><p id="f143">In total, Bot A’s operator has spent 0.535 ETH on gas fee and lost 867.5 USDC, which is the reason why we said “do not get in too early or you’ll get rekt”.</p><h2 id="8730">LBP is a game of chicken</h2><p id="8a84">Facing a situation where the price of an asset will gradually go down if no one buys it, potential token buyers can behave in three distinct ways:</p><ol><li>Waiting on the sideline and hoping people will do the same thing so he/she can buy the asset when the price is cheaper in the later days</li><li>FOMO buying now and hoping that more people will follow suit so the price won’t drop</li><li>Dividing the budget into smaller chunks and dollar-cost averaging with each chunk of the fund</li></ol><p id="d66f">As Jack Purdy from Messari points out:</p> <figure id="3243"> <div> <div> <img class="ratio" src="http://placehold.it/16x9"> <iframe class="" src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=twitter&amp;url=https%3A//twitter.com/jpurd17/status/1303732758779396104&amp;image=" allowfullscreen="" frameborder="0" height="281" width="500"> </div> </div> </figure></iframe></div></div></figure><p id="b988">When our LBP is released, most of the people choose to wait on the sideline either because 1) they think the valuation with the current price is too high, or 2) they believe everyone won’t buy the tokens till in the later days (when the token price drops), and that explains why the volume is relatively low in the early hours. And then suddenly, when the demand is much greater than the downward pressure from the weight changes and the price begins to spike, FOMO kicks in and people behave as the way #2 describes.</p><figure id="986f"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*d-Zp-hJMc8OUauaa"><figcaption></figcaption></figure><p id="bc71">A high IQ move to participate in an LBP should be picking a valuation that you’re comfortable with and then starting using way #3 when the market valuation is below the valuation in your mind.</p><h2 id="d595">Add the number of the tokens remained on the dedicated page</h2><p id="a130">We have been asked one common question t

Options

hroughout these three days on Telegram “how many tokens left?” even though people can easily find this number on Balancer and Etherscan. It would have made our life a lot easier if we had shown this metric on the page for LBP, along with the latest price, remaining time for the LBP, and the price chart.</p><h2 id="803f">Stick with human time as the starting time (but don’t change the ending block number)</h2><p id="9dca">On the LBP, we need to use block numbers to set the start and the end of the token distribution. However, as we all know that block time on Ethereum can vary from 13 seconds per block to 14 seconds per block, and for a project that runs an LBP lasting for 20,850 blocks, it means the starting time and the ending time can be anytime between 2.5 hours earlier to 2.5 hours later. What makes the matter worse is that usually, as a project owner, you’ll announce the starting and the ending time of an LBP a couple of days before the start, so there will be more deviation between the human time you plan to start and the time when the block number is reached on the Ethereum.</p><p id="0f92">To cope with this problem, we manually change the starting block number on the smart contract of our LBP from block 10,826,500 to block 10,825,600 to launch the LBP in the time that most people remember (Sep 9, 2020, at 6:00 am UTC).</p><p id="28c5">However, as for the ending time, we choose to stick with the ending block number and announce the ending time will be delayed on our Discord server because we want to make sure the weights of the pool drop to its lowest point according to the plan.</p><figure id="e4d7"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*y0sxgca00ZCniIE3"><figcaption></figcaption></figure><h2 id="f431">Increase the frequency of the weight change calls & set a higher transaction fee</h2><p id="9beb">By default, our keeper triggers the weight-changing function on the LBP at 0 minutes and 30 minutes past each hour. Since each weight change reduces the spot price of our token on the LBP, what an attacker can do is, he/she can sell the tokens before the weight change (when the token is more expensive), and then repurchase it after the weight is changed (when the token is cheaper). By doing this, the attack can essentially get tokens for free.</p><p id="6a68">There are two ways to fight against this kind of attacks:</p><p id="227b"><b>1. Increase the frequency of weight-changing calls:</b> Generally speaking, the longer the interval is between two weight-changing calls, the more suppression on the price there will be when the weight is changed, which will increase the likelihood of a successful attack. One way to counter this as a token project is to increase the frequency of the weight-changing calls, which makes each price drop significantly less thus the potential profit for an attack is shrunk.</p><p id="48be"><b>2. Set a higher transaction fee on the LBP:</b> According to <a href="https://docs.google.com/spreadsheets/d/18iT2jVWfgyyqLloP3fFsaZr-zEe4RR5o6oPGpceUXqU/edit?usp=sharing">our estimation</a>, you need to set the transaction fee to at least 2% to combat this kind of attack when the LBP is live (assuming it’s a 90/10 pool like we had). One obvious downside for this approach is, with a transaction fee as high as 2%, it’ll create psychological barriers for potential buyers to get the tokens. Future projects can remedy this downside by sending the transaction fee back to the buyers if they don’t sell any tokens during the existence of the LBP (or reward them more tokens).</p><h2 id="dbca">Shorten the duration to two days</h2><p id="9eac">The reason why we set the duration as of three days (or 20,850 blocks) is that we believe this duration will be long enough for everyone to have a chance to get our token no matter where they’re in the world. With over 1,300 participants in a time span of three days, we can conclude that a duration like this indeed broadens the rate of participation. Having said that, we would still recommend future projects to go with two-day because of two reasons:</p><ul><li>A three-day duration creates a huge customer service burden for a small team. In our case, as a team of six people, we need to use three of them to reply to incoming inquiries all across our social channels.</li><li>A three-day duration causes too many people to wait on the sideline on the first day, which is why in our case, the lowest price turned out to be around the end of the first day.</li></ul><h1 id="4e41">📝 Conclusion</h1><p id="491c">Till this point, we believe that you’ve understood the unique characteristics of Balancer’s LBP and what you can improve upon our approach if you want to distribute tokens in this way.</p><p id="1092">Despite being the first project that uses LBP to distribute tokens, we still encourage every project owner to check up different alternatives before making the call due to the fast development speed in this space. At the time of the writing, we’ve seen new token distribution approaches such as Fairswap from Lien Finance and ICBO adopted by Hegic.</p><p id="05c2">Last but not least, we hope that all of the projects that have tried out new token distribution techniques can also share their experience like we have done over here — by learning from each other, we can make this nascent industry more cooperative, and in the end, token distribution participants can also benefit from this.</p></article></body>

Everything you need to know about the first liquidity bootstrapping pool (LBP)

(2021/6/30) We just announced the next major update for Perpetual Protocol. Check the announcement here.

After a nerve-racking 20,850 blocks (around three days), the first-ever liquidity bootstrapping pool (LBP) was finally concluded on September 12 at 10 am UTC.

We’d like to use this piece to share the final result of our token distribution, the preparation we’ve put in place, and the lessons we’ve learned. Hopefully, learning from our experience, future projects can use LBPs more effectively than we did or invent more innovative token distribution methods.

If this is the first time you’ve ever heard of the LBP, here is a quick recap — The LBP is a kind of Balancer’s pool that changes its weight as time goes by to create constant downward pressure on the price, which is implemented to prevent front-running and price speculation for token distribution events. In our case, in the beginning, the weight of PERP is 90%, and that of USDC is 10%, and in the end, the weights become 30/70, as the line chart below illustrates.

🔢 Final Stats

Total participants: 1355 Final token holders: 1221 Highest price: 2.304 USDC Lowest price: 1.058 USDC Final average price: 1.635 USDC Closing price: 2.076 USDC

Price Chart during our LBP

Token Distribution after our LBP

Volume per Hour during our LBP

Size of Orders during our LBP

📦 Our Preparation for an LBP

(External) A dedicated page for our LBP

We create a page specific for our LBP, where visitors can check the latest price of PERP, the price chart since the beginning of the LBP, and the countdown to the end of the LBP.

Beneath this section, we list some useful resources to help people familiarize themselves with our protocol and some reminders if people don’t know what they’re doing.

And to make it easier for people to find this page, we add a banner on top of our main page and also put the link to this page on every announcement we’ve made during these three days.

(Internal) Keeper to update the weight at least once per hour

Because the LBP can’t change the weight settings itself, we set up a keeper to send transactions to trigger the weight change function on it at least once per hour.

And as a fail-safe for the scenario where our keeper malfunctions, we create a page with a single button that allows anyone to click a button and manually send a transaction to our LBP to trigger the weight-changing function.

The screenshot of this fail-safe site. Yes, it only contains one button.

(Internal, External) Channels to report weight changes and transactions

Since we have a keeper set up to change the weights on LBP periodically, we need a way to monitor if it works properly. We use HAL for this purpose. Whenever the weight-changing event is detected on the Ethereum, the HAL bot will share the latest weights in a public channel on our Discord server.

Besides monitoring weight-changing events, we also use HAL to monitor the transactions happening on our LBP on Balancer and share the transaction info on a private channel to gauge the current market demand.

(Internal) Simulations on different combinations of starting price, duration, and price impact from orders of different sizes

There are many parameters on an LBP that a project can adjust, such as the duration of the pool, starting weights and the ending weights for both assets, and the amount of the assets stored inside the pool. Since we’re the first project that uses Balancer’s LBP to distribute tokens, we need a way to simulate different scenarios that we might encounter when the pool is live. That’s why the Balancer team and us create a spreadsheet filled with different combinations of those parameters which help us ultimately decide to go with the plan that you’ve seen in the section above.

Some of the price charts from the simulations

Despite this thorough preparation, we still underestimate the demand from the market which results in the final ending price being greater than the starting price. We would suggest future projects that adopt LBP as the distribution mechanism to set the starting price higher than what we’ve done to reduce price speculation.

🧠 Lessons Learned

LBP can truly prevent frontrunners

When our LBP is deployed on the Ethereum mainnet, thanks to the aforementioned HAL bots on our Discord server, we can immediately spot some traders (or bots?) coming in and buying PERP even before our announcement. Below is the tale of a bot (or a trader who didn’t read the warning) getting rekt by the LBP:

🤔 2020/9/9 05:23:43 AM (UTC) Bot A spent 0.49 ETH as the gas fee to use 25,000 USDC in exchange for 14,009.68 PERP (1.784 USDC/PERP).

😊 2020/9/9 05:34:13 AM (UTC) Bot A’s operator spent 0.015 ETH as the gas fee to use 14,009.68 PERP in exchange for 25,679.34 USDC (1.83 USDC/PERP) and realized a profit of 679.34 USDC.

🤞 2020/9/9 06:01:35 AM (UTC) Bot A’s operator spent 0.015 ETH as the gas fee to use 25,000 USDC for 14,301.65 PERP (1.748 USDC/PERP)

😢2020/9/9 06:24:13 AM (UTC) Bot A’s operator spent 0.015 ETH as the gas fee to use 14,301.65 PERP for 23,453.155 USDC (1.64 USDC/PERP) and realized a loss of 1546.845 USDC.

In total, Bot A’s operator has spent 0.535 ETH on gas fee and lost 867.5 USDC, which is the reason why we said “do not get in too early or you’ll get rekt”.

LBP is a game of chicken

Facing a situation where the price of an asset will gradually go down if no one buys it, potential token buyers can behave in three distinct ways:

  1. Waiting on the sideline and hoping people will do the same thing so he/she can buy the asset when the price is cheaper in the later days
  2. FOMO buying now and hoping that more people will follow suit so the price won’t drop
  3. Dividing the budget into smaller chunks and dollar-cost averaging with each chunk of the fund

As Jack Purdy from Messari points out:

When our LBP is released, most of the people choose to wait on the sideline either because 1) they think the valuation with the current price is too high, or 2) they believe everyone won’t buy the tokens till in the later days (when the token price drops), and that explains why the volume is relatively low in the early hours. And then suddenly, when the demand is much greater than the downward pressure from the weight changes and the price begins to spike, FOMO kicks in and people behave as the way #2 describes.

A high IQ move to participate in an LBP should be picking a valuation that you’re comfortable with and then starting using way #3 when the market valuation is below the valuation in your mind.

Add the number of the tokens remained on the dedicated page

We have been asked one common question throughout these three days on Telegram “how many tokens left?” even though people can easily find this number on Balancer and Etherscan. It would have made our life a lot easier if we had shown this metric on the page for LBP, along with the latest price, remaining time for the LBP, and the price chart.

Stick with human time as the starting time (but don’t change the ending block number)

On the LBP, we need to use block numbers to set the start and the end of the token distribution. However, as we all know that block time on Ethereum can vary from 13 seconds per block to 14 seconds per block, and for a project that runs an LBP lasting for 20,850 blocks, it means the starting time and the ending time can be anytime between 2.5 hours earlier to 2.5 hours later. What makes the matter worse is that usually, as a project owner, you’ll announce the starting and the ending time of an LBP a couple of days before the start, so there will be more deviation between the human time you plan to start and the time when the block number is reached on the Ethereum.

To cope with this problem, we manually change the starting block number on the smart contract of our LBP from block 10,826,500 to block 10,825,600 to launch the LBP in the time that most people remember (Sep 9, 2020, at 6:00 am UTC).

However, as for the ending time, we choose to stick with the ending block number and announce the ending time will be delayed on our Discord server because we want to make sure the weights of the pool drop to its lowest point according to the plan.

Increase the frequency of the weight change calls & set a higher transaction fee

By default, our keeper triggers the weight-changing function on the LBP at 0 minutes and 30 minutes past each hour. Since each weight change reduces the spot price of our token on the LBP, what an attacker can do is, he/she can sell the tokens before the weight change (when the token is more expensive), and then repurchase it after the weight is changed (when the token is cheaper). By doing this, the attack can essentially get tokens for free.

There are two ways to fight against this kind of attacks:

1. Increase the frequency of weight-changing calls: Generally speaking, the longer the interval is between two weight-changing calls, the more suppression on the price there will be when the weight is changed, which will increase the likelihood of a successful attack. One way to counter this as a token project is to increase the frequency of the weight-changing calls, which makes each price drop significantly less thus the potential profit for an attack is shrunk.

2. Set a higher transaction fee on the LBP: According to our estimation, you need to set the transaction fee to at least 2% to combat this kind of attack when the LBP is live (assuming it’s a 90/10 pool like we had). One obvious downside for this approach is, with a transaction fee as high as 2%, it’ll create psychological barriers for potential buyers to get the tokens. Future projects can remedy this downside by sending the transaction fee back to the buyers if they don’t sell any tokens during the existence of the LBP (or reward them more tokens).

Shorten the duration to two days

The reason why we set the duration as of three days (or 20,850 blocks) is that we believe this duration will be long enough for everyone to have a chance to get our token no matter where they’re in the world. With over 1,300 participants in a time span of three days, we can conclude that a duration like this indeed broadens the rate of participation. Having said that, we would still recommend future projects to go with two-day because of two reasons:

  • A three-day duration creates a huge customer service burden for a small team. In our case, as a team of six people, we need to use three of them to reply to incoming inquiries all across our social channels.
  • A three-day duration causes too many people to wait on the sideline on the first day, which is why in our case, the lowest price turned out to be around the end of the first day.

📝 Conclusion

Till this point, we believe that you’ve understood the unique characteristics of Balancer’s LBP and what you can improve upon our approach if you want to distribute tokens in this way.

Despite being the first project that uses LBP to distribute tokens, we still encourage every project owner to check up different alternatives before making the call due to the fast development speed in this space. At the time of the writing, we’ve seen new token distribution approaches such as Fairswap from Lien Finance and ICBO adopted by Hegic.

Last but not least, we hope that all of the projects that have tried out new token distribution techniques can also share their experience like we have done over here — by learning from each other, we can make this nascent industry more cooperative, and in the end, token distribution participants can also benefit from this.

Perpetual Contracts
Ethereum
Defi
Dex
Perp Announcement
Recommended from ReadMedium