My journey with Solana India Fellowship — week 5

Nipun Agarwal
7 min readMar 13, 2022

I think every stock in the world is going to end up being a security token. ~Brock Pierce

GM web3 lovers. I just completed my fifth week of Solana India Fellowship, and we have started with the second phase of this fellowship. This week we dived deeper into the world of token economics and how to build our token in Rust. We also had an insightful talk by Shreyas on DAO Tooling and how he is solving a unique problem in the treasury space. I have also covered how you can create your staking solution for your token and give a specific yield to the investors. If you have not read my previous week’s experience yet, I’ll encourage you to read that first to get an idea about web3, Solana, how we started building in web3, and this fellowship.

What is token economics? 💰

Web3 seems to be the driving force of the next generation of the internet. It enables a unique state of layer and a unique dataset also referred to as the ledger, collectively managed by a network of untrusted computers. This unique state layer allows us to send digital values in the form of tokens. The economics of these tokens is token economics. Token economics could include qualities such as supply, issuance schedule, burn functions, and many more. A token’s qualities are factors that can be used to determine the quality and value of a token, presently or in the future. Token economics also deals with how robust blockchain systems can be designed to produce desirable outcomes for all network stakeholders, including token users and those responsible for validating transactions. Incentives for the investors are the driving force for the token to grow. Before launching any web3 token, it’s advisable to spend significant time on the token economics and figure out all the dynamics of your tokens.

DAO Tooling 101 by Shreyas 🛠

Treasury management is one of the biggest bottlenecks for the upcoming DAOs. In the previous section, I explained the world of token economics briefly. What happens to all the minted tokens that are just lying idle in the DAOs treasury? Well, Shreyas is solving a unique problem in this space. Shreyas is a Co-Founder at Llama. Llama is a platform that provides the economic infrastructure for DAOs. In the fast-paced world of web3, where new DAOs and tokens are launched every week, Llama enables decentralized communities to allocate their treasuries and assess results. DAOs are the defining coordination mechanism of humanity. They champion values of decentralization, programmability, and community ownership. Llama aims to be at the forefront of this innovation by building infrastructure that helps DAOs flourish. They develop treasury strategies, design liquidity programs, construct on-chain indices, and develop dashboards and financial reports. Over the past years, Llama has worked with multiple web3 projects like Uniswap, Gitcoin, PoolTogether, FWB, etc.

Shreyas started his journey with a finance job for 2–3 years, and in parallel, he was passionate about crypto. He then decided to leave his career and start working full-time in the web3 industry. Having previous connections in the web3 sector, he realized the problem DAOs face with their treasury management. Millions of Dollars are lying in the treasury, and no one looks or manages them. He signed up for ETH Global hackathon and started working on this idea for the treasury management dashboard. He received excellent feedback and decided to dive deeper into this space and build solutions for the DAOs. Llama’s vision is to be a community of experts in treasury management. The active community is actually a push for them, and no wonder why most web3 projects start building with active community support.

Actionable advice for early builders

Shipping in web3 is the key; something needs to go out to build the momentum. The feedback that you can get after your prototype is gold, and this can be used as an opportunity to build better. Time constraints can really push you forward in building your projects, and maybe that’s the reason why many hackathon projects convert into full-fledged products. Many builders feel that the crypto deployment process is time-consuming, there are so many audits involved, the development curve is steep, and you can’t do agile development. However, launching in a closed group and community is always helpful. Stripe launched their first version in a closed society, and so did Arweave. This mode helps you reiterate, consume that feedback, and refine yourself because you are still not public. Shreyas also feels that you learn most in public; it’s not always about feedback but also about the act of doing it. If you release something, you make it public you will correct all the mistakes immediately. You really know all the faults, and you learn much quicker.

Getting your hands dirty with code 👨‍💻

I think by now, you all must be aware of how essential tokens are for a DAO to scale and function. Although it’s very domain-specific and many DAOs don’t launch their tokens intentionally, developing tokens in Rust will always be helpful. In this week’s quest, we played around with tokens on JS and Rust. The first quest involved creating a basic react app that can mint our token and integrate it with the phantom wallet. We used @solana-spl for all token-related actions and @solana-web3js for the interactions with phantom and signing transactions. The quest was relatively simple, and the instructions were well defined. This quest can be further extended to many applications like games that mint your token as a reward or a crowdfunding application that rewards users with your token when they donate. You can find the complete code here.

The second quest was an exciting quest and slightly different from the pattern we were following until now. We were supposed to create our CLI-based wallet. The idea is to mimic the existing wallets and perform all CLI token-related operations. We developed this in GO, and if you have never worked with Go before like me, it might be a bumpy ride, but you learn to make CLI tools. The questbook had detailed instructions, but some errors needed to be fixed on our own. You can find the complete code here.

The last quest for this week was developing our token with Rust smart contracts. By the end of this quest, I could deploy my token using Rust and add a layer of customization as well. Isn’t that so cool? This quest was one of the toughest quests, and I found some of the concepts tough to grasp. The quest was really detailed, and all instructions were pinpoint accurate. The start was simple, but understanding CPI took a lot of time for me. CPI stands for cross-program invocation, and through CPI, a smart contract can call other smart contract functions. CPI is essential when you want to utilize some other smart contract, and it gives a modular approach to your application following the DRY principles. I completed the quest after investing some time, and I could deploy my token on the test net.

This week’s exercise was a fascinating application of Defi. We were supposed to develop our staking solution for the token that we developed in Rust. If you are not aware of Staking, it’s a process where you earn some more tokens on your tokens that are lying idle. In Solana, you can stake your SOL which validators can use to validate instructions, and you can earn an excellent yield on top of it. Developing your staking solution sounds overwhelming initially, but if you break down the problem statement into small chunks, you start getting an intuition about the solution. I created a PDA that will be used as a staking account. This account will store the user’s public key, the amount staked, and the timestamp when the amount was transferred. When a user stake coins, I move the coins from the user’s account to a shared treasury account. In general, staking your tokens has a lock-in period, and I followed a similar approach in my implementation. The smart contract will only release funds after some time has elapsed. When the user calls the release token function, the smart contract mints some additional tokens, which are transferred to the user giving them a specific yield. This can be further extended to circular flows of money where instead of minting the money, the yield can be transferred from someone else account depending on the usage. You can find the complete code here.

Key Learnings 🔑

1 It takes a lot of time to trust each other in the founding team, and web3 communities can solve this problem.
2 Launching tokens never guarantee growth; right token economics can
3 Sometimes, it’s better to invest time on the problem you are stuck at instead of skipping it. That learning experience gives you the confidence to tackle more such issues.
4 The learning curve of Solana is inversely proportional to its transaction cost :P.

Resources and good reads ㈾

1. https://shreyashariharan.com/ (Excellent articles on DAO tooling and his experiences)
2. https://llama.mirror.xyz/q1hcX8cbL3RGjUCETxlf6GyEURnQCHa_-rQqJ2yN8ng (Good read on Llama vision and model)
3. https://gov.uniswap.org/t/uniswap-liquidity-program-v0-1/13481 (Insight on uniswap liquidity program)
https://gov.gitcoin.co/t/gitcoin-treasury-diversification/9698 (Gitcoin treasury diversification)
4. https://docs.solana.com/developing/programming-model/calling-between-programs (Intro to CPI)
5. https://go.dev/doc/tutorial/getting-started (Basics of GO)

--

--