GithubHelp home page GithubHelp logo

isabella232 / dpi_arb_bot_example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from concourseopen/dpi_arb_bot_example

0.0 0.0 0.0 394 KB

A simple Arb Bot for the DeFi Pulse Index

License: MIT License

JavaScript 20.59% Solidity 79.41%

dpi_arb_bot_example's Introduction

DeFi Pulse Index(DPI) ARBITRAGE BOT Explained

If the weights of the assets included in the index become misaligned with the original index weights described in our methodology, there is an opportunity to arbitrage the index.

The arb bot utilizes flash loans to maintain the index NAV. The use of flash loans allows everyone access and can scale with the size of the arbitrage opporunity. When executed, the arb bot will assess whether the index is outside of the intended +/-5% net asset value (NAV). If it is outside this range, the bot will programatically issue (buy) or redeem (sell) the appropriate underlying assets of the index to keep the index in line with expected NAV and index weights. The current version is optimized to maintain the index weights, not for profit.

DPI ARBITRAGE BOT Important Details

Add a .env file to the root of the directory containing:

INFURA_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //your infura key

PORT=3032 //or whatever port you want to run on

DPD_KEY=xxx...... //Defipulse Data Api key to fetch gas prices from ethgasstation.info

DFP_INDEX_ADDRESS=0x1494CA1F11D487c2bBe4543E90080AeBa4BA3C2b //address of the DFP Index token

DFP_TRADE_ADDRESS=0x29656f2367cf5317915bd61c51ba2b203e975e11 //address of the DFP Arbitrage contract

PRICE_THRESHOLD=5 //price percentage difference threshold to trigger arbitrage

MNEMONIC=mnemonic of the wallet you are triggering from

To Run:

npm install

node server.js

DPI ARBITRAGE BOT SMART CONTRACT DISCLAIMER

1.) Use at your own risk; no particular outcome is guaranteed. The smart contract is currently UNAUDITED and provided as-is in the spirit of transparency and decentralization. So make sure you review and understand the code, and please only use the arb bot if you appreciate the risks and uncertainty inherent in transacting with value on Ethereum, including the volatility of gas and asset prices and the possibility (and implications) of competition for block space.

2.) It is built for the DeFi Pulse Index but can be used for other products.

3.) It uses AAVE for flash loans. However, you can utilize any flash-loan provider.

dpi_arb_bot_example's People

Contributors

celey avatar mattnumber avatar nedodn 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.