AlizadeAlireza / defi_yeildStake_with_brownie__Token-Farm__

a token farm fullStack smart contract on Aave and defi decentralized financial protocol with brownie framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

what is Aave

is a decentralized finance application that allows people to lend and borrow cryptocurrencies in turn for getting and paying fees.

is p2p lending using cryptocurrencies as the asset that is traded.

how aave's work

aave uses algorithm to determine lending rate and match the lender to borrowers. also has associated aave token witch is an Ethereum token that powers the governance on their platform.

the idea of this token is that token holders get to vote on changes to the application as time goes on.

aave utilizes the smart contracts witch is just pieces of code that get ran automatically based on certain conditions to run the platform.

aave work with P2P smart contract

instead of using peer to peer lending where a borrower had to match with a lender, aave used a peer to smart contract method.

smart contract work

so lenders can deposit money in the smart contract and earn interest and also borrowers could deposit their collateral into another smart contract and borrow from any smart contract they wanted to borrow from.

they using algorithms in the smart contract to determine the loan rates based on how much liquidity was in each smart contract.

all this is anonymous so we can say aave is a ghost.

stable coins offer more rate

tether instead of ethereum offer us more rate. because tether is a stable coin and it won't move much in price.

so if we deposit our money aave give us interest for our deposited value.

overcollateralized Loan

after we deposit some of our crypto to aave to earn interest we can also decide to borrow against it.

if we want to borrow crypto we have to be overcollateralized.

this means if we want to borrow 100$ we must to give the bank 120$.

if i gave somebody 100$ in ethereum and that guy lent me 80$ of tether that is stable coin.

we use that 80 for a few month and we decide pay it back and get our ETH, oh my god! the Ethereum that we deposite has doubled in price. we get that amount of eth but we get 200$ of ethereum instead of 100$.

liquidation treshhold

where they will automatically sell our collateral to cover the loan we have created.

this way investors never lose money.

example: we put 100$ of ethereum and what is called maximum loan to value is 80%. which means we can borrow 80% of that 100$ and we decide to borrow 80$ of tether.

so if the Ethereum price drops to more 82.5% of its value which is the liquidation precentage, the aave will automatically take our ethereum and pay back the lender. how ever we get to keep that 80 dollar that we borrowed.

leverage Lending is Possible

we have 100$ of ethereum and we deposite it to aave and withdraw 80$ of usdc which is ethereum stable token.

we get that and go over uniswap and then trade out for more ethereum and back to aave and deposit the ethereum that we take from uniswap.

now we deposite 180$ of ethereum, but still we can borrow 80% of money that we deposit it. means 80% of uniswap ethereum that we take, that can be 64$ of usdc.

if we reaped that work and give the 64$ of ethereum to aave, we have 244$ of ethereum in overall. but still we only have original 100$.

so if eth goes up 10% , we don't get 24,4 dollar more. we get our original 100$ interest that can be 10$.

paying loans back

aave loans not like traditional loans where we have to pay it all back in a certain day.

this is no fixed size period to payback the loan. as long as our position is safe we can borrow for an undefined period. as time passes the accured interest will grow, make our health factor decrease, which means result in our deposited asset becoming more likely to be liquidated.

About

a token farm fullStack smart contract on Aave and defi decentralized financial protocol with brownie framework.


Languages

Language:Solidity 65.3%Language:Python 34.7%