Using the Uniswap V2 SDK

In this post we’ll be using the Uniswap SDK to do a swap between Ether and DAI. This was done in an earlier post here. However this was using Uniswap V1 and there is now an SDK for Uniswap V2 which we’ll look at. The first thing we’ll do is use a forked version ofContinue reading “Using the Uniswap V2 SDK”

Calculating Uniswap Fees

Uniswap is one source of passive income in the Defi space, but how are those returns worked out? How exactly do you make passive income from Uniswap? And what exactly is an impermanent loss? Can you make a loss with Uniswap? It recently became important because of the price of Ether has gone crazy ofContinue reading “Calculating Uniswap Fees”

AAVE FlashLoan Test Framework

In this tutorial, we’ll be playing with Aave’s ability to do flashloans. Flashloans are described on the Aave website here. This project was initially created using Aave’s truffle box template: truffle unbox aave/flashloan-box The contracts we’ll going to be using will be mostly unchanged from the unboxing. We’re going to try and see if weContinue reading “AAVE FlashLoan Test Framework”

AAVE Deposit/Borrowing Tutorial Part IV

Borrowing in Aave This is part 4 of a 4 part series. We’ll use our existing funds to borrow a percentage of what we’ve deposited. This code is on–tutorial. Remember to create your .env with the account and private key. For brevity only the changes to deposit.js are shown. We’ll be borrowing 5 DAIContinue reading “AAVE Deposit/Borrowing Tutorial Part IV”

AAVE Deposit/Borrowing Tutorial Part III

Depositing in Aave This is part 3 of a 4 part series. Now that we have some DAI, we can deposit onto the Aave contract. This code is on Remember to create your .env with the account and private key. Security tip: never commit .env – there are bots looking for them, ready toContinue reading “AAVE Deposit/Borrowing Tutorial Part III”

AAVE Deposit/Borrowing Tutorial Part II

Using Uniswap to get DAI This is part 2 of a 4 part series. In this tutorial we’ll be getting some DAI from the Uniswap contract so we can play with Aave’s smart contracts. It would probably be simpler to go to some account that already has some DAI (and Ether for gas). Or toContinue reading “AAVE Deposit/Borrowing Tutorial Part II”

AAVE Deposit/Borrowing Tutorial Part I

Obtaining ETH This is part 1 of a 4 part series. In this tutorial we’ll be forking the mainnet and obtaining some Ether so we can play with Aave’s smart contracts. We could probably do most most of these on a testnet, but Aave lives on the Robsten testnet and Uniswap lives on the RinkebyContinue reading “AAVE Deposit/Borrowing Tutorial Part I”