What I learnt from my first week of Polygon Fellowship
Tags: ethereum, polygon, web3, blockchain
Published: 2022-06-18 18:10:49

It is interesting what all can happen in such a short time. In half a month, I have completely switched tracks over to the world of web3.
Started as a freelance frontend developer for a blockchain company a year ago, picked up some solidity and made a few interesting projects.

On 28th and 29th May, I attended the [Warpspeed](http://warpspeed.devfolio.co/) hackathon, met some really cool people and [won a prize](https://devfolio.co/projects/crossfire-477e) while I was at it.  

After that, I applied for the fellowship and in a few days I get to know that I am accepted!

> 
I didn't choose web3, web3 chose me
*Me, probably*

The first week is the learning phase where we start with the very basic concepts of blockchain development. 
I'm here to share with you what I learnt from some of the workshops held by mentors from Polygon, what I learned from the assignments and beyond.

Let's start.

**Block Explorers** 🧭
Every blockchain has its own block explorer which helps with tracking and providing information about transactions.  
For example, look at this transaction on polygonscan, a block explorer for Polygon: https://polygonscan.com/tx/0xa464f99be231de2637fe4d9d66d8c06ec4805c099fcb0d0f4e37b5960d861da2. 

![Transaction on Polygon for Adding Liquidity on Quickswap](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kh5ni8bn21j0yp4zp2go.png)
  

Here, I am adding USDT and USDC to a liquidity pool on Quickswap (I'll talk about Quickswap in a while), and I can see the **transaction hash**, **gas fees**, **tokens transferred**, **token action** and much more!  
Polygonscan is useful for understanding what a transaction did on the blockchain.

**Decentralized Exchanges (DEXs)** 💸
A DEX is similar to a centralized exchange like Binance or Coinbase. It facilitates the management of assets on the blockchain.  
A common theme you will see across some of the DEXes like [Uniswap](https://app.uniswap.org/), [Quickswap](https://quickswap.exchange/#/swap) or [Dfyn](https://exchange.dfyn.network/#/swap) is that the Swap page is always the first.  
 
Swapping allows you to exchange an existing ERC20 token for another one. For example, you can swap your MATIC for USDT, WBTC, etc.
The conversion rate is determined by the DEX and varies from one DEX to another.

**Liquidity Pools** 🐳
For swapping to take place, there has to be a pool where both of these assets are present in sufficient amounts. If you're swapping USDT for USDC, there should be a USDT-USDC pool on the DEX you're using that can take your USDT and give you USDC.  

But where does the liquidity in the pool come from?  

The answer is that users provide the liquidity. When you swap, a small fee is deducted which goes towards paying the people who provided liquidity in the pool.
You can become a **liquidity provider** too and earn just by supplying your idle tokens to a pool!

How much fees a user gets for providing liquidity depends on their share in the pool. Go back to the transaction I shared above in the block explorer section, you will see that I get **UNI-V2** tokens in return for my deposited USDT & USDC. These are called **Liquidity Pool Tokens** or LP tokens or LPTs. They represent the shares you have in the pool.  

Example of a pool I provided liquidity to on [Quickswap](https://quickswap.exchange/#/pool):
![Quickswap Manage USDC-USDT liquidity pool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5mjv28fwixrhptam8808.png) 
You can see that Quickswap charges `0.25%` fees on swaps and passes it onto the liquidity providers. This may vary depending on different DEXes.

After you have your LP tokens, you can invest in various instruments like farms or staking to further increase your returns. 

**Writing a Smart Contract** 📄
The task was to write a simple hello world contract, taken from the tutorial by the Ethereum foundation, and deploy it on the Goerli Testnet.
I have used hardhat and solidity before, so this was a breeze. The smart contract would store a string message and be able to update the message.  

I would recommend following the official tutorial by the Ethereum Foundation if this is new to you: https://ethereum.org/en/developers/tutorials/hello-world-smart-contract/

**Minting an NFT** 🦄
I have written a separate article on minting NFTs on Opensea: https://dev.to/neelansh15/how-to-mint-an-nft-on-opensea-in-5-minutes-36c3  

---
This wraps up the assignments part. There were sessions held by mentors from Polygon who shared valuable insights, some of which I'll share in brief.

**Quadratic Funding** 📈
This is related to raising funds. Suppose you're raising funds and a company is matching the donations made by the public.

The grants by company is calculated according to a given formula. The practical impact of this is that more preference is given to a project which raises say $1000 from 100 people than a project that raises $1000 from 20 people.
This is great because more number of people want the first project to succeed and naturally it should be given a higher grant.

Great article for reference and implementation example: https://devfolio.co/blog/experiments-with-inout7/

**Americana.af**
Link: https://americana.af/
This is a project that aims to turn real-world items into NFTs. These real-world items can then be bought and sold as NFTs.

**Dynamic NFTs**
NFTs (Non fungible tokens) have traits like Color, Background, Health, etc. In a normal world, static NFTs are just fine. But there are many cases where a dynamic nft is needed.  

The best example is web3 games. Say your character is an NFT which has health, power, age, etc. These traits will change as you progress in the game and thus need to be dynamic.

This also brings me to the next topic: Upgradable Smart Contracts.

**Upgradable Smart Contracts**
I had an idea about this once that what if we redirect a smart contract to a new one in order to update the code like we can do in web2.
Turns out, the concept of upgradable smart contracts by using Proxies exists! I haven't implemented it but I found the openzepplin docs to be of great help: https://docs.openzeppelin.com/learn/upgrading-smart-contracts

**DAOs (Decentralized Autonomous Organizations)**
DAOs are the standard for governance on the blockchain. Every DAO has a fixed set of rules that govern the decision-making of the organization, including how the voting takes place.

In a DAO, people who hold the tokens of that DAO are assigned some voting power. It can be in a static 1:1 ratio (1 token = 1 vote) or it can be derived from a formula or it can be mapped according to how long the user has been holding the token.

Proposals are created in these DAOs which decide the direction that it should take, according to its community members.

Once a proposal has been voted upon, the results are automatically calculated and the verdict is produced.

Example DAO: https://uniswap.org/governance
You can create DAOs for Non-profits here :) => http://lowpoly.surge.sh/
It is a project I made in college with my teammates.

---
I think I've covered the major topics that I recall. There are other smaller topics worth checking out like Infura/Alchemy and RPC endpoints, zkrollup, How Polygon works (layer, settlement, etc.), IPFS, Filecoin, etc.

This week has been phenomenal. I've learned quite a few things, interacted with mentors from Polygon and interacted with fellow members of the fellowship.

Looking forward to learning more and reporting next week. ✨

The journey has just begun! 🚀