Skip to content

KoanOps/arb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Arbitrage Bot

TL;DR

This is a work sample of Cryptoexchange, Inc's older trading bot that allowed the company to take advantage of price differences via arbitrage on Binance, written in Python using the ccxt library.

It runs in an infinite loop, continuously checking for arbitrage opportunities. When opportunities are found, the bot executes trades to take advantage of them. The bot uses multiple threads to scan opportunities in parallel, and logs its activity to a file.

Prerequisites

  • Python 3
  • A Binance account and API key
  • CCXT, a library for trading cryptocurrencies with support for a wide range of markets and merchant APIs

Configuration

The API/Secret keys can be changed in the data/secrets.py file. Do not disclose your API Key, Secret Key (HMAC), or Private Key (RSA) to anyone to avoid asset losses. You should treat them like your passwords.

  • BINANCE_KEY: Your Binance API key.
  • BINANCE_SECRET: Your Binance secret key.

The bot's behavior can be customized by modifying the values in the data/settings.py file. Here are some of the key settings you may want to adjust:

  • MIN_DIFFERENCE: The minimum price difference (in percentage) required to trigger an arbitrage trade.
  • MAX_TRADE_AMOUNT: The maximum amount (in USD) that can be traded in a single arbitrage trade.
  • MAX_SLIPPAGE: The maximum slippage (in percentage) allowed for executing an arbitrage trade.
  • REFRESH_INTERVAL: The interval (in seconds) at which the bot refreshes its data and looks for new arbitrage opportunities.

Usage

You can install the required package using pip:

pip install ccxt

To use the bot, simply run the ini.py script:

python ini.py

The bot will then start monitoring the supported tokens and exchanges for price differences, and execute arbitrage trades when profitable opportunities arise.

Disclaimer

This bot is intended only for work reference. It should not be used for actual trading purposes without extensive testing and modification. The user should fully understand the risks involved with automated trading and arbitrage, as well as any potential issues that may arise from using this code leading to potential losses. The author is not liable for any losses.

About

Arbitrage trading bot

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages