GithubHelp home page GithubHelp logo

dtl's Introduction

Decentralized Token Lending

Logo

Decentralized token lending (DTL) is a project that allows the lending of any token with ERC-20 support in a fully decentralized way. It uses the DutchX repo as a price oracle to determine the necessary value of collateral. If the value of the collateral ever falls below MINIMUM_COLLATERAL (initally set to 2x) OR the borrower doesn't return the tokens within returnTime, anyone can liquidate the collateral. In that case it is sold on the DutchX for the borrowed token, which the lender can then withdraw.

The project is structured in the following way:

RequestRegistry stores all requests to borrow tokens and allows users to create and accept such requests. Once a request is accepted, a new proxy contract is created with the LendingAgreement as it's masterCopy.

LendingAgreement is the model that all proxies point to. It allows to increase (or decrease) collateral amount, return the tokens, and liqudiate them in the cases described above.

DTL can potentially allow to short ERC-20 tokens. The current project performs the settlement layer. However, in order to be market-viable, an interest-rate layer would likely be necessary, otherwise there is no incentive to accept any lending request.

To get started, clone the project, run npm i and ganache-cli, truffle compile && truffle migrate. Or alternatively, truffle compile && truffle test. The project uses the decode-eth package, which can be called anytime using npm run decode to get a human-readable view of all tx's and all contracts locally deployed.

The DTL implements this specification: https://docs.google.com/document/d/1EuyY1oGeuvWIoGJvwh-nl_i1pgUC5nJDQNpq1WNXPCM/edit

For additional information about the DutchX, check out the repo at http://github.com/gnosis/dx-contracts.

dtl's People

Contributors

hacker-dom avatar koeppelmann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.