Coder Social home page Coder Social logo

dhedge-public-bot's Introduction

dHEDGE Public Bot

Trading bot for automated trading on the dHedge platform.

Installation

Clone this repo and copy one of the .env.Example files into .env and prefill the variables like mnemonic seed or private key for the account, pool address and Web3 provider details.

In the functions folder install the dependencies with npm i

Create a Google Firebase project. Make sure to select the Blaze (Pay as you go) plan.

Install the Firebase CLI

Run firebase deploy

Endpoints

/executeTrade

Url: https://your-region-your-project.cloudfunctions.net/executeTrade You can see the exact url in your firebase console under Functions

Parameters:

  • from: Asset to sell (e.g. sUSD)
  • to: Asset to buy (e.g. sETH)
  • amount: Amount of asset to sell (e.g. 100.123)

Example: This is the endpoint to buy ETH worth of 100.99 USD:

  • /executeTrade?from=sUSD&to=sETH&amount=100.99

Use Cases

Stop Loss Order

Setting up Stop Loss alerts in Tradinview

Follow these instructions to set up alerts in Tradingview.

Use alert action Webhook and copy the executeTrade endpoint from above.

Example set up for a sell order of 0.001 ETH when ETH price goes below $2350

Screen Shot 2021-04-19 at 10 29 33 am Screen Shot 2021-04-19 at 10 30 17 am

dhedge-public-bot's People

Contributors

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