5- 📝Tutorials Section📝 / 💱|defi-tutorials

Wallets

A cryptocurrency wallet is a device, program, or a service which stores the public and/or private keys for blockchain transactions.

There are 2 main groups for crypto wallets.

Hot wallets are the ones that have a direct connection to the internet. This wallet can be a phone app, online provider, or desktop software program. Examples are Metamask, Phantom,Terra Station, etc.

Cold wallets are portable devices that provide the capability to “carry” your crypto money. Since you interact with the assets offline, this option is more secure than hot wallets. Examples are Ledger and Trezor.

Your wallets don’t hold any cryptocurrencies. All of those are on the blockchain owned by your Ethereum address. With your public and your private key you have access to that particular address through your wallet interface. This is the same both for cold and hot wallets. Even if you lose your Ledger (physical device) you can just replace it with another one and recover your account with your seed phrase.

For our demonstrations we will use the most commonly used wallet which is Metamask. It’s worth mentioning that you can also connect your hardware wallet (Ledger) and use it with the Metamask interface. You get the simplicity and flexibility of Metamask and the safety of the cold wallet.

Always buy the physical device on the official site and always reset your device before using it. https://metamask.io/

https://www.ledger.com/

https://vimeo.com/690338690

Metamask MM is a software wallet used to interact with the EVM compatible blockchains like Ethereum, Avalanche, or Fantom. It allows users to access their wallet through a browser extension or mobile app, which can then be used to interact with decentralized applications. MM is a non-custodial wallet, you own your private key (in a form of seed phrase) unlike custodial wallets (CEX's) where the platform owns your private key. While a custodial wallet is usually considered less secure than a non-custodial wallet, many prefer them because they don’t require as much responsibility and are usually more convenient. Non-custodial wallets a double-edged sword as many people tend to fall for scams and expose their private keys. Once you expose your private key all your accounts in your MM are vulnerable. The ONLY time you have to use your seed phrase is when you login to Metamask through the MM interface. There are several ways to store your seed phrase. You have to make sure no one can get access to it besides you and you shouldn’t lose it either. Some ppl like to write it down on paper and then hide it or lock it away somewhere. I don’t like that approach personally. If you choose to do that, at least split up the words into a few chunks (if the seed phrase is 12 words then put 4-4 words on 3 different papers) and keep it in separate places. Another approach is to save it in a text file then encode it (AES 256-Bit Encryption for instance) and keep it on a USB stick or cloud storage. I prefer the latter so I never lose it. Even if someone gets his hand on your file, it’s still encrypted and protected by a strong password. One thing you shouldn’t do is keep a decrypted seed phrase on your computer. If you click on a malicious link some programs can install themselves on your computer and the hackers will gain remote control to it. If your seed phrase is not encrypted it means they have access to your private key, which means your money will be gone. (edited)

Silard - DeFi/NFTs 30-Dec-21 09:21 PM

Connecting Metamask to different chains To connect to different EVM compatible chains you have to manually add the configurations in the network setup. Main EVM compatible chains and their governance tokens are Avalanche (AVAX), Fantom (FTM), Binance Smart Chain aka BSC (BNB), and Polygon (MATIC). You can keep the same account if you want for the different chains, so bridging will be easier. From security perspective it's better if you keep some of your money in different accounts (addresses) within the same Metamask login . When I say same Metamask login I mean the same private key which is of course the seedphrase. You could do this by having different chains under different addresses or you just send some of your coins from the same chain to a separate address. E.g. you have 20ETH on one address and 20ETH. If you click on some malicious link but you don't expose your seedphrase, the hackers won't be able to touch your other accounts (addresses). I would personally recommend more laptops as well, with separate Metamask logins (separate seedphrases), so if you expose your seedphrase, you won't lose all of your money. https://vimeo.com/690339765 (edited)

Hustler's University

metamask_network_setup

This is "metamask_network_setup" by Hustler's University on Vimeo, the home for high quality videos and the people who love them.

Silard - DeFi/NFTs 11-Jan-22 02:51 AM

Tokenomics Coin vs token. These terms are used interchangeably which is not totally correct. Coin is a cryptocurrency asset. Coins are not intended to serve as utility unlike crypto tokens. It is used as a store of value or medium of exchange. To put it another way the main difference between these two comes down to utility. There are things you can do with tokens and not with coins. On the other hand, some marketplaces will accept coins and not tokens. The difference is subtle, so it will be used interchangeably below to go with the convention. It’s crucial to understand the basic tokenomics before swapping any coins. The price of a coin doesn’t mean anything without knowing the number of coins. Having 1 coin of X at price $10 represents the same value as 10 coin X at price $1. Think of some foreign currencies. 1 EUR is not the same as 1 CHF. As of this writing if you express that in dollars 1 EUR is worth 1.13 USD and 1 CHF is worth 1.08 USD. What actually matters is the price multiplied by the number of coins which represents the valuations of the particular project or company. To define the number of coins we will have to look at a few more definitions first. (edited)

Silard - DeFi/NFTs 11-Jan-22 03:05 AM

Basic definitions Maximum supply The maximum number of coins that can be ever in existence. First it gets set when the token contract is deployed on chain. It’s important to cap the supply otherwise the token value could get inflated. On top of that there are ways to take some of the coins out of circulation forever which can make the token deflationary and reduce the maximum supply. Total supply The total supply is the number of tokens that currently exists and are either in circulation or locked. It is the sum of coins that has already been mined/issued minus the total of coins that were burned. Circulating supply The circulating supply is number of coins that are available for trading in the different markets. It does not include the coins that are locked up or being held in reserve. Initial supply The number of coins that make it in circulation when the token contract is deployed. (edited)

Silard - DeFi/NFTs 11-Jan-22 03:17 AM

Basic definitions II Token emission It is the a schedule and methods of issuing new tokens into circulation. This includes when tokens will be issued for the team/VC’s/early adopters. Preferably VC’s and the team should vest over a longer period of time, so they don’t sell the tokens or abandon the project. In case of tech startups the total length of the vesting period is usually 4 years. For crypto projects this is usually reduced to 1-2 years as the industry changes at a much higher pace. Sometimes emission, mint, and unlock used interchangeably which is not correct as only the coins that have been minted can be locked. When you hear someone saying the VC’s unlock it actually means their token is being minted based on an emission schedule. Burn This a way to reduce the token supply by removing it from circulation. The use case here is to make a token more valuable by making it more scarce. Mint Don’t confuse this with minting an NFT. In this case this is just the opposite of burning. It means the increase of number of tokens in circulation. The minting details should be encoded in the smart contracts. There can be different motivations for minting but the main ones are issuing vested team/VC tokens, rewarding early adopters, or making the coin less scarce to decrease token value. The last may sound weird at first but it is a common mechanism for stablecoins to maintain peg. Lock/unlock Coins can get locked or unlocked. In general it is a mechanism to prevent people from selling that particular coin in exchange for some kind of rewards. Locking is usually happens in the form of staking/liquidity providing. Coins can get locked forever or for a certain period of time. Locking forever actually is the same as burning. (edited)

Silard - DeFi/NFTs 11-Jan-22 03:24 AM

Basic definitions III Market Cap (MC) Market cap applies to other markets as well not only to crypto. It represents the current market value of a particular token or project. It’s calculated by multiplying the price of the token with the circulating supply. If token A is worth $1 and the circulating supply is 100,000,000 then the MC is $100,000,000. If token B is worth $2 and the circulating supply is 20,000,000 then the MC is $40,000,000. The market value of token A is higher although its price is lower compared to token B. This why you compare the MC and/or FDV of tokens instead of the prices. Fully diluted valuation (FDV) The term "diluted market cap" comes from the stock market. It represents a company's valuation when all stock options are exercised and all securities are converted to stock. It’s calculated by multiplying the price of the token with the maximum supply. Let’s reuse token A and B from the previous example. If token A’s maximum supply is 200,000,000 then the FDV is $200,000,000. If token B’s maximum supply is 100,000,000 then the FDV is $200,000,000 for token B as well. (edited)

Silard - DeFi/NFTs 11-Jan-22 03:43 AM

Finding the information The basic info like price, MC, and FDV can be found on Coingecko or CoinMarketCap. If the coin can’t be found on those sites which can happen especially with newer coins a good try would be Dextools or Dexscreener. When looking a coin up make sure to use the token’s contract not the contract of the LP token. To see more about emission schedules and future event the best thing is to check the docs of the project or talk to people in the project’s discord server. https://vimeo.com/690340248 (edited)

Hustler's University

finding_token_info

This is "finding_token_info" by Hustler's University on Vimeo, the home for high quality videos and the people who love them.

Silard - DeFi/NFTs 11-Jan-22 03:51 AM

Putting it all together It takes time and experience to look at the numbers and understand what they actually mean. When an L1 chain reaches $3.000.000.000 MC it can be considered early. The same number for a DEX though is huge. Many coins (especially shitcoins) are priced as a small fraction of a dollar to make it seem smaller. Subconsciously (or sadly consciously) many people consider those coins cheap. They are not cheap, they just have huge total and maximum supplies. Always check emission schedules. Make sure VC’s/team can’t dump on you. If there is too many tokens being emissioned in a shorter period of time, the token price likely won’t go up thanks to the inflation. Compare the MC and FDV values to see what percentage of the tokens have yet to be minted. Launching with low token float (results in overinflated FDV) can have high potential on the short run at the cost of long term pain as the large FDV creates sell pressure. Don’t lock your coins for longer periods of times even if the rewards look juicy. In crypto everything is changing by the day. (edited)

Silard - DeFi/NFTs 12-Jan-22 02:22 AM

Staking By staking in the section we don’t mean PoS (proof of staking) which is a consensus algorithm. Staking is a form of locking your coins in exchange for rewards. It usually happens in a decentralised way, but some of the CEX’s also allow you to stake your coins. We will focus on the former. When you stake your coins you will get confirmation in the form of staked tokens. If you for example stake $SPELL you will get $sSPELL (staked $SPELL) as a receipt which you will see showing up in your wallet. To get back your $SPELL you will have to unstake your $sSPELL. The rewards come in several forms. The main ones are voting rights, liquidity mining programs, or revenue share. Since you get rewards after your staked tokens they are also called interest-bearing tokens. Besides earning interest, in some cases you can sell those on secondary markets as well. Even better if you can use your staked tokens as collateral or liquidity for other projects. You could stake your $SUSHI and get $xSUSHI (staked $SUSHI) for it, then put that into abracadabra money ($SPELL) as collateral and earn more rewards. With that collateral you could also borrow some $MIM (stablecoin) and do whatever you want with it. Just remember, in order to get back your $xSUSHI, you will have to return your borrowed $MIM. Make sure you don’t lock your coins for a longer period of time. Some projects give you juicier staking rewards if you are willing to lock your coins for months or years. (edited)

Silard - DeFi/NFTs 12-Jan-22 02:43 AM

Staking calculations Sometimes people use APY (annual percentage yield) and APR (annual percentage rate) interchangeably which is incorrect. Even projects mix it up from time to time, so it’s better if you always double-check what the numbers actually mean. APR stands for the yield that you get yearly based on your initial investment without compound. Let's say you stake 1 ETH for 365% APR. (1 + 3.65)^1 = 4.65 After a year you will make 3.65 ETH profit and will be able to take out 4.65 ETH. This is assuming your yield gets paid in ETH and the yield stays constant during the whole year. APY stands for compounded yield. It means the project has a mechanism in the smart contract to auto-compound your yields. If you take the previous example and your yield is auto-compounding once a day for a year then you will get more money. Let’s exclude the gas fees for the following calculation. 365% APR means 1% growth daily which is compounding once a day. (1 + 0.01)^365 = 37.78 This means you can take out 37.78 ETH (36.78 ETH profit) after a year which translates to 3678% APY. In general staking yields tend to fluctuate over time. If the staking feature is based on initial staking program to acquire new users then you can expect the yield to decrease quickly. If staking is a way of revenue distribution without any extra boost, the APR could go up if the project performs well. 3678% APY is exceptionally high. It’s very important for you to understand what the source of that money. Let’s do a calculation now from APY to APR. As of this writing there is a project called $TIME ($OHM fork on Avalanche chain) where the staking APY is around 66700% with compounding 4 times a day. Let’s see what the APR is in this case. Over the year it will compound 4 x 365 = 1460 times. 66700% is the profit which means if you have 1 TIME to start with, you will have 1 + 667 = 688 TIME in the end. (1 + x)^1460 = 668 x = 0.0044649 which translates to 0.44649% every 6 hours.

Silard - DeFi/NFTs 17-Jan-22 10:59 PM

AMM (Automated Market Maker) A decentralized application that provides a way to swap/trade tokens in a non-custodial way is called a DEX (decentralized exchange). The swap only executes if the conditions are met by all parties. If any of the conditions is not met the transaction is reverted and all parties retain their funds. AMM vs Order book The are 2 main mechanisms for the swaps. Order-book matching and AMM (automated market maker). In the case of order-book matching implementation all the parties have to agree on the swap exchange rate. The market makers can create bids at a certain price and allow others to fill those bids. Until the bid is taken the market maker can withdraw the offer or update the price. In some cases this can be inefficient as both parties have to agree on the price to be executed which means you won’t be able to always find buyers/sellers. An AMM is a smart contracts that holds assets in the form of liquidity pool (LP) for both sides of the trading pair and automatically sets the price for trading based on a price curve. One of the main advantages compared to the order book mechanism is that you don’t need a counterpart to execute a trade, so you can execute your trade any time. Your funds are also in your custody until the transactions goes through which means there is no counterpart risk. There are other important benefits as well that we won’t discuss here. (edited)

23:04

AMM implementations In this section we will focus only on pool2 (constant product formula) and stable swap formula. Pool2 is the original AMM mechanism by Uniswap v2. Most of the other main DEX’s (Sushi, PanckakeSwap, SpiritSwap, TraderJoe, etc.) use this mechanism as well. There is also a newer Uniswap version (v3) which is more advanced and won’t be discussed here. The other main implementation is the stableswap formula which was created by Curve finance to trade highly correlated assets. Constant product formula The Uniswap v2 (pool2) trading price ratio is defined with the x * y = k trading curve ratio where x is the balance of token A, y is the balance of token B, and k is a constant invariant that never changes. To maintain this k invariant if you want to sell A, B must be bought by the contract and vice versa. Stableswap formula The constant product invariant doesn’t make any assumption about pricing of underlying assets and spreads liquidity across all prices evenly. The stable swap invariant enables to focus most of the liquidity around 1.0 (or any other price) which is great for creating liquidity for stablecoin pairs.

Silard - DeFi/NFTs 17-Jan-22 11:21 PM

Constant product calculation We will use ETH- USDC pool for the example and will neglect gas fees and transaction fees. The pool has 100 ETH that currently trades at $100 and 10.000 USDC that of course $1 each. 100 * 10.000 = 1.000.000 This gives us an initial state of 1.000.00 for constant k. Let’s say we wanna buy 20ETH. 1.000.000 = (100 -20) * x x = 12.500 This means we have to pay 12.500 - 10.000 = 2.500 USDC to get 20 ETH. The price before our transaction was $100 / ETH but since we only got 20 ETH for swapping 2.500 USDC we paid $125 / ETH. Let’s try to buy 20 ETH again. Currently the pool looks like this: 1.000.000 = 80 * 12.500 After the 20 ETH buy it's gonna be: 1.000.000 = (80 - 20) * x X = 16.667 We have to pay 16.667 - 12.500 = 4.167 USDC to get 20 ETH. The price before our transaction was $125 / ETH but we only got 20 ETH for swapping 4.167 USDC which translates to $208 / ETH. As you can see the more one sided the pool gets the bigger the price difference will be for the swaps. (edited)

23:22

23:29

Slippage Slippage is basically when a trade settles for a different price than expected or requested. To put it another way it is the price difference that occurs between the token’s quoted price and the paid price. High slippage is present in markets with high volatility and/or low liquidity. Let’s reuse the the initial pool from the example above. If you were to put in an order for a 20 ETH buy but someone else at the same time puts in another 20 ETH buy order both of you would expect to pay $125 / ETH for that order. But if the other transaction gets executed before yours that person pays the expected $125 / ETH and you will pay $208 / ETH. That’s a huge difference. Slippage could be both negative and positive but most likely it is gonna be negative thanks to how transactions work. AMM’s let you set slippage tolerance so you can protect yourself from much higher prices than you would expect. If the slippage tolerance is too low, your order may take longer to execute or not execute at all. If it is too high, another trader or a trading bot may see your pending transactions and front-run you. Front-running If another trader/bot sees your high slippage, by setting a higher gas fee than yours, will make his transaction execute first. After your transaction goes through as well, the front runner inputs another trade to sell it at a higher price that was made possible by you. Make sure you don’t set the slippage too high 0.5-1% should work well.

Silard - DeFi/NFTs 23-Jan-22 09:14 PM

Providing liquidity AMM’s can only work effectively if the liquidity pool is deep enough, so the swaps between two tokens will be executed with an acceptably low slippage. In our previous example the pool had 100 ETH and 10.000 USDC initial liquidity. Liquidity can be provided by adding the same value of both tokens based on the current state of the liquidity pool which means 1 ETH for every 100 USDC with the current state of the pool. Let’s add another 100 ETH (10.000 USDC value) and 10.000 USDC to the pool. The new constant invariant can now be calculated as: (100 + 100) * (10.000 + 10.000) = 4.000.000 With this liquidity provided we have a deeper pool. Let’s try the 20 ETH buy swap again. 4.000.000 = (200 - 20) * x x = 22.222 It costs 22.222 - 20.000 = 2.222 USDC to but 20 ETH. This translates to $111 / ETH price. As expected thanks to the deeper pool the price difference is smaller. By default liquidity providers get 0.3% after each trade. On top of that with liquidity mining programs those LP tokens can get additional yield but there is risks involved as well.

Silard - DeFi/NFTs 23-Jan-22 10:12 PM

Impermanent Loss (IL) There are some risks involved with LP’s. Besides the usual smart contract risk there is also impermanent loss. Impermanent loss occurs when you provide liquidity to a pool, and the price of your assets are different compared to when you deposited them. The bigger the change is, the more you are exposed to impermanent loss. We will use the previous numbers for the calculation. You added 100 ETH and 10.000 USDC to the pool. That represents 50% of the pool. In this example we assume while ETH goes up to $400, the liquidity remains constant in the pool (k = 4.000.000). While this is happening, arbitrageurs will add USDC to the pool and take ETH from it until the ratio reflects the current price. As we learned earlier the price of the assets in the pool is determined by their ratio. Let's calculate the number of ETH and USDC coins in the pool. 4.000.000 = x * 400x, where x is the number of ETH;s. 10.000 = x^2 x = 100 (number of ETH coins in the pool) Now we have 100 ETH and 40.000 USDC in the pool. If you take your money out (50% of the pool) you will get 50 ETH and 20.000 USDC. That’s worth 40.000 USDC at $400/ETH price. If you had decided just to hold onto those asset instead, you would have 100 ETH and 10.000 USDC which is 50.000 USDC. As you see you just lost 20% of your money thanks to IL. (edited)

22:15

Silard - DeFi/NFTs 25-Jan-22 04:11 AM

If you completed everything above, click on the moon emoji to progress to #💬|de-fi-chat

8

Silard - DeFi/NFTs 05-Mar-22 07:14 PM

How to make money in DeFi - Being early in promising projects - Buying into great but more mature projects - Narratives - Yield farming Being early in promising projects Finding quality projects and researching them is pretty time consuming but rewards can be great. You will have to go through many discords, whitepapers, and twitter posts and quickly evaluate the projects to find a few good ones. Type of plays: - Copy of existing project on different chains. This is the easiest way. Every chain needs AMM’s, lending protocols, yield farming protocols, etc, so finding them early can be highly profitable. - Finding the next primitives of DeFi. Think of DeFi 2.0 projects in 2021 like SPELL, OHM. These projects are clearly different from the earlier DeFi protocols and either try to build on top of existing ones or they are a highly improved version of them. DeFi is still in its infancy and it’s changing quickly. Projects that were relevant just half a year ago are gone, and the newer improved versions took over their place. - Projects building on top of existing projects with a clear dependency and specific use case. You could argue every yield farming project is dependent on underlying protocols but this is more like a spectrum. In some cases the connection is very clear. A good example would be Convex and Curve. Convex just makes it much easier for users to interact with Curve. If Curve collapsed for some reason Convex would be gone as well.

Silard - DeFi/NFTs 07-Mar-22 02:52 AM

How to make money in DeFi II Buying into great but more mature projects Some projects have already proved themselves and seem to stay here for the longer run. You could call these the last first movers. A good analogy would be Facebook 15 years ago when it emerged as the main social network. There were many social networks back in the day but Facebook could take the leader position and ruled for a long period of time. At that point the internet was more mature though than DeFi right now, so it's harder for a project to reach this status. You should think about the reasons why the projects would stay here. Many of them have the spotlight for a while but then quickly disappear. As examples you could mention $CRV again. Narratives Like most things in crypto DeFi works in cycles too. When a new trend emerges many new projects try to ride the wave. If you catch the wave early there is serious money to be made. A good example is OHM forks. First few projects were great investments but then of course the market got saturated quickly. Another example is Avalanche rush in 2021 August. Avalanche projects got a huge liquidity injection to bring people over to avalanche. Thanks to the huge yields ppl started bridging and buying up tokens. Ppl who were early made a ton of money.

Silard - DeFi/NFTs 10-Mar-22 04:02 AM

How to make money in DeFi III Yield farming There are several approaches for yield farming. If you have a ton of capital it’s easy to farm stables in mature protocols for small yield (10-15%) and chill. If you don’t have too much money or you wanna do riskier plays you gotta play it differently and join riskier pools and newer projects. Yields are usually high when a project launches as they need initial liquidity to make the project usable. As more money comes in the yields decline quickly. New projects have higher smart contract risk and also could be just straight scams. It’s usually a good idea not to join the farms immediately. Wait for a while or wait until there is at least a few million dollars in TVL. The pairs on one side usually have a stable or a chain gov token like ETH or FTM. On the other side it’s more volatile protocol tokens (FTM-SPELL on spiritswap) or the protocol gov token (FTM-SPIRIT on spiritswap). The uncorrelated pairs have higher yields but of course they are prone to impermanent loss. It’s a good idea to only join the volatile pools if you expect the token prices to go up or stay around the same value, so you won’t lose money on IL. If a pool has high APR you can expect more participants joining soon to get those yields. If you join the pools of a new protocol with the gov token on one side (the token you get the rewards in), you have to be super cautious as the token gets heavily diluted thanks to the high emissions. Some people like to play in the middle of the risk range with less volatile coins (but not stable) or older protocols with acceptably high APR’s. It’s usually not worth it. I would rather do just staking and miss out on a few percentages of extra yield.

Silard - DeFi/NFTs

If you completed everything above, click on the moon emoji to progress to #💬|de-fi-chat

Silard - DeFi/NFTs 30-Apr-22 02:29 PM

Don't forget to click on this moon emoji in that message and then check #🔑unlock-defi-nft-access channel to access other rooms. (edited)

2

Silard - DeFi/NFTs 03-May-22 08:57 PM

We also created a web app for you guys where you can calculate the things you learned about above. You can access the app here: https://hustlers-university.herokuapp.com/

HU2

HU2 app

Exported 25 message(s)