Git Product home page Git Product logo

hashstrat's Introduction

hashstrat

A Pool contract that implements a simple crypto investment fund.

Users depoist DAI into the pool and receive PoolLP tokens back that represent their share in the pool. New PoolLP tokens get minted when DAI are deposited into the pool and get burt when DAI are withdrawn from the pool. The Pool can spend some of its DAI to buy WETH on UniswapV2, or can sell some WETH for DAI. The Pool uses a rebalancing strategy to target a 60% / 40% split allocation of WETH and DAI. This means that the value of WETH (in DAI) aims to be about 60% of the overall value of the Pool (in DAI). The strategy waits for the value of WETH in the Pool to go above/below the 60% target by a preset thereshold (e.g 15%) before rebalancing. The Pool uses Chainlink keepers to automate the Pool rebalaning operations. The price of WETH/USD is also provided by a Chainlink feed.

NOTE: Deployment scripts can deploy to Kovan only.

Requirements

  • NodeJS (v18.0.0)

Installation

  1. Install truffle
npm install truffle -g
  1. Install dependencies by running:
npm install

# OR...

yarn install

Customize Environment vars:

Edit vars in .env file:

MNEMONIC="<12 memonic words here>"
RPC_URL="https://kovan.infura.io/v3/<infura_project_id here>"
ETHERSCAN_API_KEY="<etherscan api key here"

Test

npm run test

Deploy (Kovan)

npm run migrate:kovan:

Verify contracts (Kovan)

npm run verify

hashstrat's People

Contributors

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