ExchangeUnion / market-maker-bot

MM Bot for OpenDEX. Make profits via arbitrage between OpenDEX and a connected CEX account like Binance 🤖
GNU Affero General Public License v3.0
105 stars 20 forks source link
arbitrage-bot arby binance bitfinex kraken market-maker opendex

Market Maker Bot

Arby

Arby is a market maker bot that allows to easily arbitrage between OpenDEX and centralized exchanges like Binance. In other words, anyone with capital to spare is able to "earn interest" on their assets by running arby and providing liquidity to the OpenDEX network.

The overall goal of Arby is to pull liquidity from centralized exchanges into OpenDEX and incentivize this process financially.

How it works

Arby looks for arbitrage opportunities on the OpenDEX network. It issues orders on OpenDEX based on the price of a connected centralized exchange, adding the configured margin on top. It will update the orders as soon as the price on the centralized exchange changes.

Trades on OpenDEX are settled in seconds. This allows arby to execute the counter trade on the connected centralized exchange right after an order is settled on OpenDEX. Since the order on OpenDEX was issued with an additional margin, the trade on the centralized exchange can almost always be settled for a significantly better price. The price difference between the two trades is the profit (the "interest") arby generates.

Example with real numbers:

Currency OpenDEX Binance
BTC 1.0 1.0
USDT 11000 11000

Scenario A
Currency OpenDEX Binance
BTC 2.0 0.03
USDT 1300 20700

Scenario B
Currency OpenDEX Binance
BTC 0 2.03
USDT 21300 700

Total BTC balance between OpenDEX and Binance 2.0 + 0.03 = 2.03 BTC (0.03 BTC yield) Total USDT balance between OpenDEX and Binance 21300 + 700 = 22000 USDT


FAQ

Which exchanges are supported?

Currently, Binance and Kraken are supported. Bitfinex is next on the roadmap.

https://github.com/ExchangeUnion/market-maker-tools/issues/92

What happens if I lose connectivity to Binance?

Arby will automatically remove all orders on OpenDEX until connection is re-established.

What happens if the order quantity is too big to execute on Binance?

Arby will not execute trades on OpenDEX that it cannot counter-trade on Binance.

What happens when the order quantity is too small to execute on Binance?

Arby will automatically accumulate the traded quantity on OpenDEX and only execute an order on Binance when it is greater than or equal to the minimum amount on Binance.

Is it possible to configure Arby to take profits in non-BTC assets?

Support for taking profits in other assets (ETH, DAI, USDT etc.) is technically supported, but currently not enabled.

What about rebalancing between centralized exchange and OpenDEX balances?

Support for automatic rebalancing of the assets is planned in the upcoming releases.

Setup instructions

Recommended way of running Arby is by following the market maker guide.

Development Setup

The setup guide below is only for development purposes. Please refer to the guide above for production use.

The development mode assumes a working xud setup with functioning swap clients for all currencies Arby is configured to use.

Requirements
Install dependencies

npm i

Configuration

Copy .env-example to .env

Start in development mode

npm run dev:arby

Tests

npm run test or npm run test:watch to continuously run the tests.

Disclaimer

This is alpha software. Please be extra careful when using this on the mainnet.