Skip to content

interest calculated with integer math in a smart contract

Notifications You must be signed in to change notification settings

partylikeits1983/defiBank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple DeFi Lending Protocol Proof of Concept

How it works:

  1. Users can deposit Eth and earn interest.
  2. Users can take out a loan in Eth, but will have to pay interest.

In return for providing liquidity, users are given ERC20 tokens that have a 1 to 1 peg to Eth. Depositers can redeem these tokens for Eth at a later date.

The interest accruded by the contract is split proportionally between liquidity providers.

Currently there is no functionality of providing collateral, therefore, the contract currently is depending on good faith, however, I may choose to implement functionality that requires users to provide colateral to take out a loan from the contract.

Check out docs/interest.ipynb to see the logic of how interest is calculated in the smart contract

Interest as a function of liquidity pool size, current amount lended, and time

About

interest calculated with integer math in a smart contract

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published