Coder Social home page Coder Social logo

smartcoding51 / defi-yield-farming Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 4.0 503 KB

A DeFi app, which provides staking & farming functions are deployable with a website

License: MIT License

JavaScript 70.72% HTML 6.18% CSS 0.08% Solidity 23.02%
solidity yield-farming truffle javascript staking defi openzeppelin

defi-yield-farming's Introduction

DeFi Yield Farming

This truffle project focuses on developing a DeFi app which implements the concept of yield farming / liquidity mining based Dai token.


This repository presents practices about:

  • Setup a blockchain.
  • Develop Ethereum smart contracts.
  • Write tests for the developed Ethereum smart contracts.
  • Develop a client-side website so people can actually use this application.

ToDos:

  • Add OpenZeppelin Contracts to minimize risks.
  • Develop a new feature to keep track of the rewards.
  • Implement a method to withdraw the rewards automatically when certain conditions are met (it is triggered manually in the current version).

Theory

What is yield farming?

At its core, yield farming is a process that allows cryptocurrency holders to lock up their holdings, which in turn provides them with rewards.

In brief:

  • Yield farming lets you lock up funds, providing rewards in the process.
  • It involves lending out cryptos via DeFi protocols in order to earn fixed or variable interest.
  • The rewards can be far greater than traditional investments, but higher rewards bring higher risks, especially in such a volatile market.

Application Software Architecture

Here is the application software architecture work-flow:

  • Users use an Internet browser to connect front-end application which is written in HTML, CSS and JavaScript.
  • Then, instead of accessing a back-end server, the website talks directly to the blockchain which is where all the codes and data for the application lives.
  • The DeFi application codes are contained in smart contracts written in solidity progrramming language which was a lot like JavaScript. These smart contracts are immutable which means the code can not change and all the data is stored in the public ledger which is also immutable. And, anytime new data is added to the blockchain, it will be permanent and publicly verifiable.

Installation

Setup

  • Node.js

    sudo curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
    nvm install 12.18.3
    node -v
    
  • Truffle

    sudo npm install -g [email protected] --unsafe-perm=true
    
  • Ganache installation guide can be found in here.

  • MetaMask installation guide can be found in here.

Commands

  • Install necessarily Node.js packages

    npm install
    
  • Deploy smart contracts to the Ethereum blockchain

    truffle migrate --reset
    
  • Deploy and run the front-end application

    npm start run
    
  • Run the scripts to issue tokens

    truffle exec scripts/issue-tokens.js
    

Author

Kei Nakano

License

This system is available under the MIT license. See the LICENSE file for more info.

defi-yield-farming's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.