DeFi Mini Course: Part 4, Decentralized Hedge Funds

Before You Get Started on Part 4.

In this part, you’ll learn how to buy tokens in a decentralized hedge fund and then stake those tokens so you can vote as well as earn rewards. If you’ve missed Parts 1 – 3 of this course, here are the links – all prerequisites for this Part 4:

  1. Part 1, Wallet Setup for DeFi.
  2. Part 2, Uniswap, a Decentralized Currency Exchange.
  3. Part 3, Lending Platforms.

At a minimum, you’ll need a MetaMask wallet with about $50 worth of Ether to do this part of the course. Skip back to Part 1 for guidance on how to add to your wallet.

This course is priced at $9.99. If you find the course helpful – but don’t have the money to spend right now – I’d appreciate if you could instead share the course on social media or with two friends.

Disclaimer: Crypto is still in its infancy and very high risk. I recommend setting the expectation that you will lose all of the money you invest as you’re learning and treat it as an education. Throughout the mini-course, I will indicate the cryptos I hold myself, so at least – if you do copy me – I’ll lose money if you do! This course is not investing advice, it is intended to teach you how DeFi works! You are reading these materials and taking any guided steps at your own risk. Crypto is technical and funds are easily lost if you are not careful with passwords as well as sending and receiving money to/from the right wallet addresses – not to mind bugs in nascent software platforms or bad actors. Learn with small amounts to minimise your risk.

Part 4, Decentralised Hedge Funds

The problem of fees when earning crypto income

You’ll recall from Parts 2 and 3 that transaction costs for moving, exchanging or lending cryptos are high. As of Jan 2021, it can cost $20 per transaction just to move crypto from one wallet to another. Here are two the two basic transaction costs in DeFi – through the lens of a lending example:

  1. Depositing crypto into smart contracts. You’ll recall, from Part 3, lending out some USDC on Compound or Aave. Depositing the crypto will have cost you Ether to pay for gas.
  2. Withdrawing crypto from smart contracts. Once done lending, you’ll have to withdraw your crypto from the lending platform, again costing you gas.

Unfortunately, it’s worse than that because currently – in the early stages of DeFi – significant returns are earned not only through interest but also by receiving platform tokens as rewards. As a specific example, lenders and borrowers on the Compound platform earn Compound tokens for their participation, in proportion to interest earned/paid. This leads to a third transaction cost:

3. Rewards token withdrawals/conversions. You earn Compound tokens as you lend on the platform. At some point, you’ll want to convert these compound tokens into another crypto – likely back into USDC if you are engaged in a USDC strategy.

So you have this cycle where you earn Compound and then have to pay to convert it into USDC and then pay again to lend that USDC out.

Decentralized hedge funds as aggregators

Given the high cost of gas (transaction fees – which are largely flat fees per transaction), it makes sense that individuals might pool their funds together in order to reduce gas costs as a percentage of their funds. This is where platforms like harvest.finance and yearn.finance emerged.

A group of yield “farmers” pull together and write some smart contracts that allow them to invest in strategies (such as lending on Compound) together. Here is how one such strategy might work:

  1. A USDC lending strategy is set up that invests USDC on Compound.
  2. Compound tokens that are earned are automatically converted – using Uniswap or similar – for more USDC tokens, and this USDC is then reinvested in the USDC strategy.

This is called auto-compounding. The Harvest smart contracts automatically do the work of reinvesting profits. If you want to withdraw your funds from the pool, you get back your initial asset plus your proportional share of compounded profits.

The fees charged by Harvest

In return for this smart contract service, Harvest takes 30% of any profits made by investments (liquidity pools) on the platform.

That might seem like a lot! It is! However, gas fees are so high that investors still find it cheaper and easier to invest via Harvest and pay that 30% fee. As of Jan 2021 there is over $500M invested on the harvest.finance platform.

Where do the Harvest fees go?

They go to… yet another governance token – called FARM!

So the owners of FARM earn 30% of all profits earned by the liquidity pools on the Harvest platform.

Now, the harvest.finance platform offers all sorts of earning opportunities (lending, exchange pools etc.), so by owning FARM you own 30% of the profits across a wide variety of diversified yield farming strategies. Tasty! (also Risky!)

Now, before diving in with a DIY step, some risks with diversified hedge funds:

Risks of diversified hedge funds like Harvest.finance

As with any DeFi initiative, there is smart contract risk involved in diversified hedge funds, only this time you’re taking on multiple layers of smart contract risk. There are the smart contracts for the earning platforms (e.g. Compound or Aave), but now you’re taking on a further layer of risk by investing via the harvest.finance layer of smart contract. There’s actually a third layer of smart contracts as well, if you’re to earn FARM rewards, which we’ll get into in the DIY section below.

Things can go very wrong indeed on DeFi platforms. Take a look at when the Harvest platform itself was subjected to an attack in October 2020 with over $30M made by the attacker at the expense of the platform. In understanding the attack, it may be of help for you to read on further and then come back to this section where I’ll give a high level overview.

In October 2020, the USDC and USDT pools on Harvest were attacked. Each pool was investing assets on the Curve.fi platform. Essentially, the attacker used a large amount of money (~17M) to move the price of USDC vs USDT on Curve, and then swooped in and out of the USDC pool on Harvest with ~$50M – taking advantage of the price mismatch cause on Curve.fi . The attacker made over $500k each time doing this and repeated the attack over ten times on the USDC pool in Harvest, and then on the USDT pool – sucking out over $30M in value from Harvest in the process.

Why did this happen and how could it be stopped? At a high level, this happened because the attacker was able to do a lot of transactions very quickly. Flash loans (where you simultaneously buy and sell at the same time) were allowed. Flash loans were subsequently disabled on Harvest, and the Harvest smart contracts broken down into more steps – which increases transaction costs (gas) – but improves security.

Harvest even then pulled together a reparations program for those who lost money and created a token called Grain to work towards making them whole. Still, FARM trades at a huge discount (over 10X) to Yearn – a competing hedge fund platform that has a similar level of assets invested.

When it comes to DeFi – particularly multi layered contracts – Caveat Emptor!

Investing with FARM and in FARM

There are two different ways to make money with or in Harvest.

  1. Investing in liquidity pools – which is just pooling your money with other investors into third party strategies (e.g. on Compound or Aave or Uniswap liquidity pools).
  2. Investing in FARM token itself – which is like taking ownership in a hedge fund and earning a share of the platform’s profits.
  1. *Investing in Liquidity Pools

*Navigate to app.uniswap.org, connect your Metamask wallet and swap $10 worth of Ether for $10 worth of USDC (you’ll have to pay for gas as usual using additional Ether in your wallet).

*Navigate to Harvest.Finance and hook up your metamask wallet.

*Scroll down to “Stablecoins”, click the dropdown and seek out USDC.

You can see USDC at the bottom, put 10 in the USDC box. Notice, to the right of the USDC symbol you can see the annualised return on the asset (based on recent returns – not guaranteed annual returns!). You can also see how much USDC is in the pool ($18.71M here), and you can see how much you’ve already deposited (I’ve got 20.227… deposited). You can also see some symbols for Compound, Idle, and Farm – the cryptos involved in the strategy.

So what’s happening here? In this USDC strategy, your USDC is going into a pool of $18.71 worth of USDC and invested into an Idle smart contract. Idle is a platform that moves money between lending platforms (like Compound and Aave) depending on where the best interest rate can be received. Idle has a platform token called Idle that you earn for using the platform. So Idle then takes the USDC and further invests it – in this case – using Compound’s platform, where the USDC earns interest but also Compound tokens

It’s a very multi layered strategy, the overall effect of which is that you lend USDC and receive interest (paid in USDC), Compound and Idle in return. Furthermore, the smart contracts sell off any Compound and Idle tokens earned and use the proceeds to buy more USDC. This means you are auto-compounding USDC to the tune of 28.56% on an annualised basis (measured based on recent returns, not a guaranteed return!).

*Scroll down and click “Deposit and Stake”:

“Deposit and Stake” button at the bottom right

Which leads to the question – what’s the difference between Deposit and “Deposit and Stake”?

Well, by depositing, you are simply pooling your USDC and investing in the strategy as described above. Technically, what happens here is that you lock your USDC into a smart contract, and the Harvest platform gives you back a fUSDC token in return. (if you locked in USDT instead, you could get back fUSDT). This fUSDC token just serves as your receipt for your investment.

However! You can take that receipt (the fUSDC) and further entrust that to a Harvest contract in return for earning some FARM rewards. This is called staking, and means you trust the platform in holding your receipt.

Actually, the 28.56% return mentioned above includes all forms of return – interest, Compound, Idle and FARM. So if you don’t stake your fAssets (the collective term for assets like fUSDC, fTUSD etc) then you won’t get quite as high of a return.

2. Investing in FARM itself

Alright, so we’ve seen above how you can earn auto-compounding interest on specific assets using harvest.finance. You can alternatively get exposure to the whole platform of assets on harvest by buying the FARM token – which earns 30% of any profits made on the platform. This is a different kind of risk profile than providing liquidity to pools – as described with USDC above – in particular because there are no assets underlying FARM tokens. Specifically, if you invest USDC in a liquidity pool, you are entitled to withdraw that USDC at any time (absent any smart contract issues). By buying FARM you are not committing assets to a smart contract that earns a return, but rather just buying an asset.

*Navigate to app.uniswap.org, connect with Metamask, and convert $10 worth of Ether for $10 worth of FARM (you’ll need to do some back of the envelope maths to figure this exchange rate out.

*Navigate to https://harvest.finance/earn and click on FARM Profit Sharing.

*Now enter the number of FARM that you have and click stake:

Use the bottom fields to stake farm. At the top, you can see that I have 10.6 FARM staked at the moment.

A recap on what you get from staking FARM

  1. The ability to vote on FARM governance matters
  2. Profitshare of 30% of liquidity pools (you get this indirectly because the platform uses those profits to buy FARM on the open market).
  3. Emissions! Yes, Harvest is still in the early phases and they are giving out FARM tokens every week to different groups, including those who have staked FARM (and USDC as in the last example).

Some Parting Technical Thoughts

Where do platform rewards come from – such as Compound or FARM? As mentioned above, by using certain platforms you can earn rewards (e.g. FARM tokens earned for using Harvest.Finance). When a platform is getting set up, those initiating the platform often decide to mint platform tokens and distribute them in certain amounts over a certain period of time. The total supply of tokens to be printed may be limited (such as Celo Gold, CGLD), or may be at the discretion of a majority vote of the platform tokens (also known as governance tokens). The ways in which tokens are distributed also varies widely, but often is designed to reward the platform founders and/or incentivise the use of the platform by early adopters. In short, platform tokens serve at least two purposes:

  1. Governance – with a majority vote of the tokens allowing changes to be made to the smart contracts.
  2. Rewards – to incentivise certain behaviours on the platform.

Interestingly – some of these tokens have no intrinsic value in themselves, other than the ability to govern the platform. Some examples:

The Farm token is entitled to 30% of the profits from liquidity pools on the platform.

The Uniswap token is not entitled to any profits, but there is a provision that 0.05% of the 0.3% transaction fee can be redirected to the protocol at some point in the future.

The Compound token does not earn anything at the moment, but it does govern the platform, so its value accrues from the right to divert earnings to the token at some point in the future. Yes, interesting…

Where do the 30% of profits actually flow – are they directly paid to FARM holders? Actually, no. Profits are used to buy FARM tokens on the open market, which puts an upward effect on the price of FARM – it’s kind of like a company buying back its own stock.

Almost done with Part 4 on Decentralized Hedge Funds!

So you now have a way to invest in liquidity pools and strategies while mitigating fees and automating the selling and reinvestment of any platform tokens received.

You also have a way to earn a share of profits from a diversified range of strategies.

That brings us to the Part 4 quiz and the end of this introductory DeFi course. If you enjoyed it, consider letting one or two more friends know about it, and also signing up for my monthly newsletter so you don’t miss out on any more DeFi updates from me.

Once you’ve clicked Submit on the quiz, scroll up to see your answers!

DeFi Mini Course: Part 3, Lending and Borrowing

Before You Get Started on Part 3.

In this part, you’ll learn how to lending and borrowing works on COMPOUND or AAVE, and lend out some USDC for yourself.

You’ll need a MetaMask wallet with about $30 worth of Ether and $10 of USDC (from Part 2) to get part 3. Skip back to Part 1 for guidance on how to fill up a wallet.

This course is priced at $9.99. If you’re new to crypto, you’ll need to read through Part 1 and buy some crypto before clicking the Buy button. If you find the course helpful – but don’t have the money to spend right now – I’d appreciate if you could instead share the course on social media or with two friends.

Disclaimer: Crypto is still in its infancy and very high risk. I recommend setting the expectation that you will lose all of the money you invest as you’re learning and treat it as an education. Throughout the mini-course, I will indicate the cryptos I hold myself, so at least – if you do copy me – I’ll lose money if you do! This course is not investing advice, it is intended to teach you how DeFi works! You are reading these materials and taking any guided steps at your own risk. Crypto is technical and funds are easily lost if you are not careful with passwords as well as sending and receiving money to/from the right wallet addresses – not to mind bugs in nascent software platforms or bad actors. Learn with small amounts to minimise your risk.

Part 3, Lending and Borrowing

DeFi is like a bank, but you can participate in being the bank 🙂

When you borrow from a bank, there is collateral involved. If you borrow for a house, you promise them the house to secure the loan. Same if you borrow for a car.

As far as I know, you can’t yet borrow for a house or for a car on DeFi. Right now, you can only borrow to buy a different crypto, e.g. you can borrow Ether , but you have to offer some other crypto as collateral, say Bitcoin.

Now, this might seem pointless for day to day life and… It largely is! Bear with me…

The current reasons for borrowing and lending are – primarily – for financial engineering. I’m going to cover these financial examples because I want to provide a sense of the full range of DeFi services to further my point that DeFi is like a bank, but you can be served by the bank or being part of the bank yourself… for better or worse!

Borrowing on a DeFi platform

Let’s look at a hypothetical example where you start with 10 Ether, each Ether worth 1,000 USDC:

Grandad Mick goes to a DeFi lending platform (like Aave or Compound) and uses his Ether to borrow USDC. Using 10 Ether as collateral (together worth 10,000 USDC), the platform allows Mick to borrow 8,000 USDC (80% of your collateral). They won’t allow Mick to borrow the full amount of his collateral, just as most banks won’t allow you to buy a house without a deposit – unless it’s 2008…

You take that 8,000 USDC and you buy 8 more Ether. Now you have 18 Ether in total.

Let’s say Ether doubles to a price of 2,000 USDC – so you know have 36,000 USDC worth of Ether. Grandad Mick is in good shape! He pays back his loan of 8,000 USDC (plus interest – which we’ll ignore for now) and now has 28,000 USDC (or 14 Ether) – a tidy profit of 4 Ether.

Now, let’s look at the downside scenario. Let’s say that Ether priced in USDC drops by just 10% down to 900 USDC per Ether. Mick’s collateral of 10 Ether is now worth only 9,000 USDC, and his lending limit (80% of collateral) is now only 7,200 USDC – which is now less than your loan of 8,000 USDC. Here’s what happens next – and I’ll use the AAVE example.

The Aave protocol now allows great-aunt Mary – sitting over there in the armchair – to swoop in and repay up to 50% of borrowed amount (at the new cheaper price) and get a 5% bonus from Mick! She repays 50% of the borrowed 8,000 USDC = 4,000 USDC for 4.44 Ether (4,000 / 900), plus gets a bonus of 0.22 Ether – for a tidy packet of 4.66 Ether. Fair play to you great aunt Mary!

Off of 10 Ether of initial collateral, Mick has now lost 4.66 Ether – pretty harsh for a 10% drop in the price of Ether per USDC. Ouch!

So, what’s happening here? Basically, the platform (Aave) is making it highly punitive for borrowers to go below their borrowing limit and incentivising them to have a lot of collateral behind their borrowings in case prices fall. This mechanism is designed to make it safer for lenders to lend, but it’s not entirely safe!

Sudden and large price movements

Let’s say Ether drops to 200 USDC. Mary can now repay 50% of Mick’s borrowed 8,000 USDC for 40 Ether – but there isn’t 40 Ether of collateral for her to take – there is only 10!!! There is insufficient collateral backing borrowings!

What happens next depends on the lending platform. Some platforms – like Aave – use a governance token to provide reserves, or partial reserves, against this kind of a scenario. Depending on the severity of price movements, those reserves may or may not be enough to save the day. Ultimately, if there is not enough collateral or reserves, it’s the lenders that lose out – that’s the risk they are getting paid for.

So now that you see one of the risks of lending (and remember there is always smart contract risk as well – the risk that the code makes a mistake) – let’s try out some lending.

*Lending on a DeFi Platform

*Navigate to https://app.aave.com/deposit or to https://app.compound.finance/ and connect with your MetaMask wallet. Note that you can use Aave with a Coinbase wallet – Aave’s documentation is also more clear.

*Select USDC (USD Coin) and then deposit/supply $10 of USDC.

*You’ll be prompted to select your transaction speed (duration). If gas fees are very high ($20+), you may wish to come back another time and hope they are lower. Yes, gas is very expensive right now.

*You’ll now start to earn interest on the USDC that you have supplied. (On Aave, you’ll be given aUSDC in return, on COMPOUND you’ll receive cUSDC).

One last question then…

How are interest rates set?

As a concrete example. Let’s consider that there are lenders lending 100 Ether and borrowers borrowing 50 Ether. That ratio – of borrowing to lending – is called the Utilisation Factor.

The platform (Aave or Compound) puts together an algorithm that aims to increase the Utilisation factor to a certain level (a level that is different for each crypto). They do that with an interest rate curve that pays more interest as the utilisation increases – which encourages more lenders to come onto the platform. Here is an borrow rate curve for USDC and USDT – both US dollar stablecoins:

Note that there are variable and fixed rates – we won’t get into the details for that.

One last point on interest rates – you’ll see that borrowing rates are always higher than lending rates. Check out the comparison for yourself here: https://app.aave.com/markets .

The reason for this is the Utilisation Factor being less than one, i.e. only a portion of assets loaned to the platform are borrowed out by borrowers – and the interest paid by borrowers is shared out among all lenders to the platform (regardless of whether none, part or all of their lendings to the platform are being used by borrowers).

Almost done with Part 3 on Lending Platforms!

So, with DeFi, where there is a service (e.g. currency exchange or borrowing), there is also a complementary earning opportunity (e.g. providing liquidity to exchanges or lending). These earning strategies are also known as farming or yield farming.

Taking this a level further, you can imagine a platform that splits money between different earning strategies – somewhat like what a hedge fund does in traditional finance. That’s what harvest.finance and yearn.finance do – and we’ll cover those in Part 4.

First, take a look at the quiz below before moving on to Part 4.

Once you’ve clicked Submit on the quiz, scroll up to see your answers!

DeFi Mini Course: Part 2, Currency Exchange

Before You Get Started on Part 2.

In this part, you’ll learn how to swap one crypto for another on Uniswap so you can lend it out on the COMPOUND or AAVE platform in Part 3 of this course.

You’ll need a MetaMask wallet with $100 worth of Ether. Skip back to Part 1 for guidance on this.

This course is priced at $9.99 for a four part series. If you find the course helpful, but don’t have the money to spend right now, I’d appreciate if you could instead share the course on social media or with two friends. If you’re new to crypto, you’ll need to read through Part 1 and buy some crypto before clicking the Buy button.

Disclaimer: Crypto is still in its infancy and very high risk. I recommend setting the expectation that you will lose all of the money you invest as you’re learning and treat it as an education. Throughout the mini-course, I will indicate the cryptos I hold myself, so at least – if you do copy me – I’ll lose money if you do! This course is not investing advice, it is intended to teach you how DeFi works! You are reading these materials and taking any guided steps at your own risk. Crypto is technical and funds are easily lost if you are not careful with passwords as well as sending and receiving money to/from the right wallet addresses – not to mind bugs in nascent software platforms or bad actors. Learn with small amounts to minimise your risk.

Part 2, Currency Exchange

DeFi is like a bank, but you can participate in being the bank 🙂

In the same way that banks make money by offering currency exchange and lending services, you can participate in DeFi and earn money just as a bank does.

This part of the mini-course will walk you through a currency change platform (UniSwap) where you can either exchange currency OR earn crypto by supporting the currency exchange mechanism.

Exchanging Currency on UniSwap

You will exchange some of your Ether for USDC (US Dollar Coin), so that you can later lend it out on Compound or Aave in Part 3 of this course.

US Dollar Coin (USDC) is what’s known as a stable coin. Each USDC has it’s value backed by a real US dollar that is held in reserve. Stable coins make it easier to transact with crypto because – unlike with Bitcoin – their value is fixed relative to a real/fiat currency and does not fluctuate. USDC is one of the more popular stable coins (others include Tether or Celo USD) and it is one that is supported for lending on Compound, as well as earning a good interest rate, which is why we will choose it for now.

*Swap $10 worth of Ether for USDC

*Navigate to app.uniswap.org and connect in using your Metamask wallet.

*Select Ether and USDC and adjust the amount of Ether you’ll swap until it gives you an output of about $10 of USDC. It should look a bit like this:

There are a few costs to keep in mind before you press Swap:

  1. Transaction costs (gas) – which will depend on how busy the network is. Probably will cost you a between $3-$15. Yes, expensive! We’ll discover a partial solution to that in Part 4 of the course!
  2. Liquidity Provider Fee of 0.3% – paid to those facilitating this exchange (learn how to earn that in the next section!).
  3. Price impact – the larger your trade, the bigger the difference between the exchange rate you get and the current exchange rate. For trades as small as we are doing here, this will be small.

*Click Swap and you’ll be directed to choose your transaction speed, which affects your gas price. There’ll be a link to Etherscan where you can see your transaction status.

You now have USDC that you’ll be able to lend out on Compound or Aave in Part 3 of this course.

How can you be the bank with UniSwap?

Alright, so you’ve seen how to use UniSwap to exchange crypto. You can alternately make money by facilitating this exchange. As a concrete example, let’s think about how you could facilitate (as the bank) the EtherUSDC trade that you just did – known as “being a liquidity provider”.

At the time I did the transaction above, the price of USDC was 0.0008 Ether. The way Uniswap works for liquidity providers is that you contribute both Ether and USDC to a pool of funds (known as a liquidity pool) in the same ratio as the current exchange rate between the two cryptos. For example, you could contribute 0.0008 Ether and 1 USDC to a an Ether-USDC pair liquidity pool. [We won’t actually do this because we’ll waste too much gas for these small amounts invested, but you can do so using your Metamask wall here: https://app.uniswap.org/#/pool].

The reward the liquidity pool gets for providing that liquidity is 0.3% of each transaction submitted to that pair’s liquidity pool, distributed among pool providers according to the value they provide. That’s how you make money as the bank!

A few further notes on that 0.3%. This is 0.3% of each transaction submitted to the pool – not 0.3% of the pool. To figure out what your return is on lending to the pool you have to divide the daily transaction fees received by the pool by the total amount of funds in the pool – and then annualize that ratio to get an annual rate. UniSwap does that for you, and you can see the instantaneous interest rates being earned on different pair pools here: https://info.uniswap.org/pairs .

Which leaves us with one more key question – how is the exchange rate determined and updated on Uniswap? The answer is market forces… read on.

Calculating Exchange Rates on UniSwap

During a transaction on a UniSwap liquidity pool, the ratio between the two cryptos must obey the relationship x * y = constant, where x is one crypto and y is the second.

For example, in an ETH-USDC pool, the product of the number of Ether times the number of USDC must be constant during a transaction. What does that mean?

Well, lets say there are 8 units of Ether and 10,000 units of USDC in a liquidity pool. Now, I – as someone who wants to exchange Ether for USDC come along with 11 Ether. The formula the exchange must follow is:

8 * 10,000 = (8 + 1) * (10,000 – z), where z is the amount of USDC I get for my 1 Ether.

Solving for z, I get back $1,111 USDC.

There’s a subtle but beautiful point here, the more of a currency I need to exchange, the worse of an exchange rate that I get from the pool. This is by design because it makes it expensive to manipulate/attack the price of the pool by doing sudden exchanges. I realise I’m not giving a precise explanation of an attack here, but hopefully you can grasp the high level point that the system is designed to make attacks expensive.

How exchange rates are maintained on UniSwap

The question you should now be asking yourself is how – if someone can swap one currency for another using a pool – the pool doesn’t get imbalanced and move away from the exchange rate in the broader crypto market. For example, could someone buy up all of the Ether using USDC?

In fact, the exchange rate does move! But, market forces move it back to equilibrium. For example, if the pool moves to 1,100 USDC per Ether on Uniswap but you can find an exchange rate of 1,200 USDC per Ether on another exchange platform (e.g. Sushiswap), then an arbitrage opportunity opens up and participants will buy Ether on Uniswap and then sell it on Sushiswap. Yes, the platform names are hilarious.

The bad news – and yes there is bad news for liquidity providers – is that this process of arbitrage is a cost to the liquidity pool. According to the x*y=constant formula, the larger the value of the constant (i.e. the size of the liquidity pool), the less the effect on exchange rate of a transaction of fixed size. This loss to the pool is called impermanent loss, and is a risk of providing liquidity to pools. Generally, the larger the pool and the less volatile the cryptos being exchange in the pool, ,the lower the impermanent loss. As a concrete example, exchange pools involving stable coins like USDC will generally have less impermanent loss than exchange pools involving Bitcoin or Ether (not stable coins).

My perspective on Uniswap

I don’t own any Uniswap governance token. I’m not an expert on Uniswap but my initial sense is that I like the platform and the incentives are community driven. There is the option for 0.05% out of the 0.3% liquidity provider fee to be redirected to the protocol at some point in the future, so potentially the UniSwap token might accrue value from that in the future. For now, the token seems focused on governance and I think Uniswap is providing a useful exchange service to the crypto community.

Further Technical Notes – for the Quiz Bonus Section!

Uniswap Pool Formula – Actually, it’s not x * y = constant. The constant increases slightly on each transaction because there is a transaction fee of 0.3% of the transaction amount.

GOVERNANCE – Many DeFi platforms, such as UniSwap and Compound, have what’s called a governance token – often named after the platform (e.g. UNI and COMP). This governance token often has a form of voting associated with it that allows the platform to propose, accept and reject changes to itself. Sometimes the token purely serves as governance. Sometimes the token also earns a share of transaction fees on the platform and/or is issued to participants in the platform to incentivise certain behaviours (e.g. providing liquidity to a certain pool). We won’t delve too much into this until Part 4 of this course where I’ll cover Harvest.Finance and the FARM governance token.

A note on fees – What we are doing here buying small amounts of crypto (e.g. $10) doesn’t make financial sense because any return that might be earned lending out this small amount is easily be dwarfed by the cost of gas. With improvements to the Ethereum protocol, gas prices should go down over the next years. For now – it’s necessary to invest larger sums of money in DeFi to get a return beyond gas fees. There is a partial solution to that – pooling resources with other market participants – and we’ll get to that in Part 4 of this course.

Almost done with Part 2!

You now understand how exchanges work on DeFi…and you have some USDC ready in your wallet. Take the quiz below! If you pass, you’re ready to move to Part 3 and lend out your USDC on Aave or COMPOUND!

Once you’ve clicked Submit on the quiz, scroll up to see your answers!

Wifi that stretches for miles

Summary:

  • Helium provides a communication network using hotspots that people install in their homes.
  • As a hotspot owner you earn helium tokens – a cryptocurrency – for providing coverage.
  • There are now about 5,000 hotspots in the world, providing full coverage in most major US cities.
  • So far, the Helium network has been used for tagging/tracking devices and also smart water meters, among other applications.

What is the Helium Network?

The easiest way to think of Helium.com is as a communications network – just like for mobile phones, but with two key differences:

  1. There are no phone/internet masts providing coverage. Coverage is provided by regular people plugging a device (called a hotspot) into their standard internet router.
  2. Each hotspot can cover miles in distance. This is less than radio, but a lot longer than wifi.

People like you and me (yes, I did buy one) buy a hotspot, plug it in at home, and then are providing coverage to the network. At the time of writing, there are about 5,000 hotspots active in the world:

4,995 Helium Hotspots on January 11th 2021

Why would you run a hotspot?

If you have a hotspot you get paid for providing coverage and also for transactions that happen on the network. Surprise surprise, you get paid in cryptocurrency – called Helium – worth around $1.25 at the time of writing.

I myself bought a hotspot for $349 back around October 2020 and have had it running since then. Right now, I’ve earned roughly 450 Helium tokens, so I’ve made about $600 by now providing coverage. If you’re interested, you can track how many tokens each hotspot is making at https://www.sitebot.com/helium/hotspots/. Some of these hotspots are making absolute coin (over 20,000 Helium tokens from one hotspot in Cambridge, MA that got in early on the platform) – particularly in places where there enough hotspots to communicate with a few others but not so many that the rewards start to get shared too much.

These high returns are temporary and will reduce as more people buy hotspots. Right now, hotspots seem to be back ordered as far as the end of March 2021 or later.

Furthermore, much of the Helium tokens being earned are due to what is called “Emissions” – the euphemism for printing money! Like Bitcoin, there is a specific schedule during which Helium (HNT) tokens are minted over time and given to those who provide coverage. Over time this reduces, and hotspot owners become more reliant on users of the network paying them for transactions. Which brings us to the next important question:

Why would anyone use the Helium network?

The Helium network is low bandwidth, which means you can use it to send something like a text message, but not video content. This makes the network good for small devices that need to be low cost and use low amounts of battery. The best example is tracking devices (could be for lost items, or dogs) or passive devices like weather stations or water flow meters – particularly those at a low price point that need to run on very low battery.

Many of you may know Tile.com – a trackable tag you can put on anything and then find using Bluetooth. Well, Helium have developed their own device called Helium Tabs, which is basically the same thing, but not limited by bluetooth. Looks pretty good on paper (I haven’t tried them):

Features of Helium Tabs

Is the Future Bright for Helium?

The Amazon Risk

The biggest risk I see with Helium is someone like Amazon competing with them. How? Amazon already sells doorbells and Alexa devices to homes that are connected to internet. Simply by adding additional frequency bands to the hardware, Amazon could very quickly build a network across pretty much all cities in the world… Amazon is already doing this in a way via their Sidewalk program.

Why would Helium succeed?

Helium founders (e.g. Amir Haleem – an eSports guru, Sean Fanning – Napster founder, and Sean Carey) and investors (Khosla, Google Ventures) are experienced, so that’s a plus.

The other angle Helium is pushing is the decentralised or “The People’s Network” benefit over Amazon (where Amazon would control it’s hotspots, even if it’s your device). There are a few points worth noting on this:

  1. It is always a delicate balance between allowing a network to be decentralised and also being a for profit business involved in that business. Facebook had a challenge building the Libra cryptocurrency, where it tried to set up a quasi-autonomous governing body.
  2. There is a risk that companies will start to buy up networks of Helium hotspots. There are chat groups already about putting together larger and wider spanning hotspots. Ensuring incentives are aligned towards growth and sustenance of the network is challenging.

All of this said, I am glad that Helium are doing what they are. It is a very interesting example of a network, and of using a decentralised and crypto approach to running the network. I’ll certainly be hodling my helium tokens and keeping my hotspot running.

Parting Questions to Keep in Mind

  • How will Helium Tabs perform versus Tile?
  • What impact will Amazon sidewalk (or similar) have on Helium?
  • How will the price of Helium tokens evolve over time (so far, it has been reasonably steady)?
  • Will hotspot ownership continue to be distributed or will it get concentrated into the hands of fewer people/groups?

P.S. www.Fleetspace.com is also worth a read and they combine low power wide area communication with a satellite approach.

If you enjoyed reading about this project, and would like to follow more projects that you can try out for yourself, you might be interested in subscribing to the newsletter:

DeFi Mini Course: Part 1, Wallet Setup for DeFi

About the Mini-Course

This is a learn-by-doing mini-course in decentralised finance (DeFi). The idea is to let you explore how decentralised finance works and how to make (or lose!) money in decentralised finance. Each part of the course will include:

  1. A short introduction to the theme.
  2. DIY sections – marked with a (*).
  3. A short quiz to test your learning.

Course duration: 4 X 1 hour sessions (including DIY activities & quizes).

What is DeFi? Decentralized finance (commonly referred to as DeFi) is an experimental form of finance that does not rely on central financial intermediaries such as brokerages, exchanges, or banks, and instead utilizes smart contracts on blockchains, the most common being Ethereum.

Who is the course for? If you already have some Bitcoin, this course is probably about at the right level. You don’t need to know code, but this course is somewhat technical and hits an intermediate level. You’ll also need to be willing to spend $100 on this course in order to complete the transaction costs in the DIY steps.

Mini-Course Outline:

  1. Part 1, Wallet Setup for DeFi.
  2. Part 2, Uniswap, a Decentralized Currency Exchange.
  3. Part 3, Lending Platforms.
  4. Part 4, Harvest.Finance, a Decentralized Hedge Fund.

Course Pricing:

I’ve priced this course at $9.99 for a four part series. If you find the course helpful, but don’t have the money to spend right now, I’d appreciate if you could instead share the course on social media or with two friends. If you’re new to crypto, you’ll need to read through Part 1 and buy some crypto before clicking the Buy button.

Disclaimer: Crypto is still in its infancy and very high risk. I recommend setting the expectation that you will lose all of the money you invest as you’re learning and treat it as an education. Throughout the mini-course, I will indicate the cryptos I hold myself, so at least – if you do copy me – I’ll lose money if you do! This course is not investing advice, it is intended to teach you how DeFi works! You are reading these materials and taking any guided steps at your own risk. Crypto is technical and funds are easily lost if you are not careful with passwords as well as sending and receiving money to/from the right wallet addresses – not to mind bugs in nascent software platforms or bad actors. Learn with small amounts to minimise your risk.

Part 1, Wallet and MetaMask Setup

DeFi is built on Ethereum. What is Ethereum? What is Ether?

As of January 2021, most decentralised finance (DeFi) is done on Ethereum, which you can think of as a software platform. You may think that Ethereum is a cryptocurrency, so saying “on Ethereum” may be somewhat confusing to you. In fact, you can think of Ethereum as a software platform (kind of like windows for cryptocurrencies), and Ether is the native cryptocurrency of the Ethereum platform.

In order to do operations on the Ethereum platform – for example, move crypto from one wallet to another – you need to pay for those operations in what is called “gas”. The currency that you pay gas in is called Ether, which is why Ether is considered the “native” crypto currency of Ethereum.

The units of gas needed depend on the transaction complexity. For example, a simple transaction might use 21,000 gas, while a complex transaction might use over 1,000,000 gas.

Finally, because one Ether is worth quite a lot, it is common to use the unit of gigawei or gwei, which is one billionth of one Ether. The price per gas at the time of writing (Jan 2021) is about 40 gwei. It depends on the price of Ether and also on how busy the Ethereum network is. Users of the network (you!) set the price per gas you are willing to pay, and miners are incentivised to choose transactions that pay more per gas. So,

  • If the price of Ether (in USD) goes up – then the gwei is more valuable to miners, so price per gas goes down.
  • If the network is being used heavily, then price per gas gets bid up.

You can check instantaneous gas prices here: https://etherscan.io/gasTracker.

It’s all a bit confusing, but this calculation helps out for a sample transaction cost:

= 100,000 gas * 40 gwei per gas * 1e-9 gwei per Ether * 1 Ether per $1,200

=$4.8 in cost for the transaction

So, to do operations in Decentralized Finance, you need to have some Ether (or gwei), let’s buy some now!

*Set up MetaMask and Buy Some Ether.

To buy some Ether, you need to have somewhere to keep it aka, a wallet. What is most handy is to use a wallet that can interact with a browser. In blunt terms, you will run DeFi software in a browser tab, and need to be able for the browser to push and pull money from your wallet. One easy to use wallet that can do that is MetaMask.io , which is what I use.

*Head over to MetaMask and set up a wallet (either on your phone or browser). Make sure to keep your password and your wallet seed phrase in a password manager and/or written down safely.

*Buy $100 worth of Ethereum. Metamask will allow you to do that. I recommend a very minimum of $100 to get through this mini-course because you’ll need to cover gas costs to try out the DeFi platforms. Note: I hold a similar level of Ether to pay for gas costs. I don’t hold Ether as a long term asset. [If you experience issues using Metamask to buy crypto from a UK or Irish bank account, an alternative option is to create an account on Coinbase, purchase Ether, and then transfer that Ether into your Metamask wallet.].

*If you still need to pay for the mini-course, you can do that using Metamask to send crypto to the wallet address presented when you press the Buy button above.

*Lastly, in your browser (I use the Brave browser, but Chrome will also work), go to Extensions (brave://extensions/ or chrome://extensions) and then find & install the Metamask extension. This is what will allow you a browser tab to interact with your wallet.

Cryptos that are Built on the Ethereum Platform.

Ether is the native crypto of the Ethereum software platform. However, it is possible to build other cryptos using Ethereum. In fact, there are many such cryptos, including the following cryptos that we’ll take a look at in this mini-course:

  • Uniswap, a governance token for the Uniswap decentralized crypto exchange platform, i.e. you can swap one crypto for another (more on that in Part 2).
  • Aave or Compound, governance (and reward) platforms allowing you to loan or borrow cryptocurrencies to others (more on that in Part 3).
  • FARM, a governance (and profit share) token for a crypto hedge fund (more on that in Part 4).

Back to Metamask for a brief moment… Metamask is a wallet that allows you to hold Ethereum based cryptos (e.g. Ether, Compound, Farm, Uniswap). Bitcoin is not built on Ethereum so you cannot buy or hold Bitcoin using metamask.

Further Technical Notes – for the Quiz Bonus Section!

wBTC – There is actually a way to use Bitcoin on the Ethereum platform, and that’s called wrapped Bitcoin. The idea behind wBTC is to have an Ethereum based token that is backed by one Bitcoin for every wBTC token that is in existence. This allows you to transact in Bitcoin using Ethereum software. [Technically, wBTC is an ERC-20 based token – which you can think of as a software subset of the Ethereum platform.]

Buying non-Ethereum based tokens – If you do want to buy non-Ethereum cryptos like Bitcoin, you can use a service like Coinbase (my referral link earning you $10 if you sign up and invest $100 in crypto). You could even use Coinbase to buy Ether and then transfer it to your Metamask wallet. You may get a better exchange rate using Coinbase than Metamask (using Wyre) but you’ll then have to pay for gas to get your crypto from Coinbase to a Metamask wallet. For a $100 purchase, it’s probably easier to buy in MetaMask – unless you trust Coinbase more.

You’re now ready to engage in Decentralised Finance!

You now have a suitable browser (Brave or Chrome), you have a wallet that can engage with browser apps (Metamask) and you have $100 worth of Ether, which we will use to buy other Ethereum based cryptos, and also to pay for gas (sigh….) as we move crypto around.

Take the quiz below! If you pass, you’re ready to move to Part 2:

Once you’ve clicked Submit on the quiz, scroll up to see your answers!