A trading bot written in Rust based on the orderbook delta volume.

Overview

Orderbook Delta Bot

A trading bot written in Rust.

The strategy based on the concept of mean reversion. We look for large deviations in the volume delta of BTC-PERP on FTX at a depth of 1. These deviations could be caused by over-enthusiastic and over-leveraged market participants.

We counter-trade those deviations, and enter short/long positions based on triggers given by a large deviation (> 2 SDs) on the orderbook delta from a (10-20) period rolling bollinger band.

We are testing this with BTC-PERP on FTX, which has good liquidity and small spreads. In principle, the scheme could be modified for lower liquidity pairs too, perhaps by adjusting the bollinger band width and length for generating triggers.

We use the definitions :

Name Definition
delta_perp Difference between bid and ask volume at depth = 1 on BTC-PERP
bb_upper Upper bollinger band of delta_perp
bb_lower Lower bollinger band of delta_perp
Trigger Position
delta_perp > bb_upper short
delta_perp < bb_lower long

A full analysis of this strategy is detailed in here.

You might also like...
A multipurpose (including music) Discord bot written in Rust

filloabot-rs A multipurpose (including music) Discord bot. This is a full rewrite using Rust of the original FilloaBot. Some features that were consid

A blazingly fast 🔥 Discord bot written in Rust

rusty-bot 🦀 A blazingly fast 🔥 Discord bot written in Rust. Commands name use !rm count deletes old messages !meme subreddit sends a random meme

A Discord bot, written in Rust, that generates responses using the LLaMA language model.
A Discord bot, written in Rust, that generates responses using the LLaMA language model.

llamacord A Discord bot, written in Rust, that generates responses using the LLaMA language model. Built on top of llama-rs. Setup Model Obtain the LL

A Discord bot, written in Rust, that generates responses using the LLaMA language model.
A Discord bot, written in Rust, that generates responses using the LLaMA language model.

llamacord A Discord bot, written in Rust, that generates responses using the LLaMA language model. Built on top of llama-rs. Setup Model Obtain the LL

Powerfull Discord Raid Bot written in Rust, use VPN / Proxy because creating 200 channels in 10s Will ratelimit you.

Harakiri-Rust This the first Discord Raid Bot made in RustLang I recommend you use with a VPN or a Proxy to evade Discord Ratelimit. If bot doesn't st

A Telegram bot written in Rust.

Knight-Bot Table of Contents About Support chat Installation Setting up your environment Build manually Commands Commands on TODO list Find this bot A

Scripture lookup bot written in Rust.

ChapterVerse This is a port of an existing project built using Unreal Engine 5, running on a linux build hosted on AWS. https://github.com/EveryGoodWo

Telegram bot help you to run Rust code in Telegram via Rust playground
Telegram bot help you to run Rust code in Telegram via Rust playground

RPG_BOT (Rust Playground Bot) Telegram bot help you to run Rust code in Telegram via Rust playground Bot interface The bot supports 3 straightforward

A Simple, But amazing telegram bot, Made using the Rust language!

Telegram bot in Rust A fun Telegram bot made using Rust language.

Comments
  • Issue with other pairs than BTC/ETH

    Issue with other pairs than BTC/ETH

    Hi there,

    I noticed when using other pairs other than BTC/ETH, it will give the following error: [2022-06-01T17:23:08Z INFO orderbook_delta_bot] The bot is not running live, no orders will be placed thread 'main' panicked at 'Multiplication overflowed'

    Maybe it has to do with the precision required for each pair? What can we edit or adjust to be able to run for other pairs?

    Kind regards.

    bug 
    opened by Pusherman2 3
  • Issue with orders

    Issue with orders

    Hello,

    I randomly stumbled across your repo and wanted to test out your implementation. Unfortunately, when I ran the bot, I experienced a few errors.

    When I first set it up, I got an error saying "Unable to place order, Err: API("Invalid reduce-only order"). image

    To fix this, I set reduce-only to false in order_handler.rs which seemed to fix the issue.

    Unfortunately, I also encountered a second problem which occurs after the bot initially takes a trade where it is unable to set a take-profit and stop-loss order and spits out the following error: image

    This one, I'm not sure how to fix. Haven't had too much time to dive into the code. If you have any tips or suggestions please let me know. Any help would be greatly appreciated, thank you in advance :)

    bug 
    opened by krazzarkov 1
  • Archiving `orderbook-delta-bot` due to FTX criminality/insolvency

    Archiving `orderbook-delta-bot` due to FTX criminality/insolvency

    Nothing really to say, I will probably write a future version supporting a different exchange (ideally Binance, because of liquidity, but perps are not supported in my jurisdiction).

    I look forward to the day I can write this for a decentralized and permissionless on-chain protocol.

    Thank you for all your feedback and DMs.

    opened by dineshpinto 0
Owner
Dinesh Pinto
Quantum Physics PhD @ EPFL & Max Planck Institute. Pythonista & Rustacean.
Dinesh Pinto
Extreme fast factor expression & computation library for quantitative trading in Python.

Extreme fast factor expression & computation library for quantitative trading in Python.

Weiyuan Wu 22 Dec 8, 2022
Matrix bot inspired by Shirt Bot.

matrix-openai-bot Matrix bot inspired by Shirt Bot. Usage Run the bot after building it or grabbing the latest release $ matrix-openai-bot Edit the ge

null 5 Oct 26, 2021
Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers.

Arcadia Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers. Contributing Always run fmt.sh before making a Pull Request! MacOS

InfinityBotList 3 Dec 15, 2022
A rust(serenity) based discord bot for the hacksquad discord server

A Discord Bot for Hacksquad How to Deploy? Requirements Docker Docker Compose Steps To Run Copy the docker-compose.yml and .env.example files to your

HackSquad 5 Jan 4, 2023
Music bot written in Rust

Akasuki What is Akasuki? Akasuki is a simple discord music bot written in rust. Highlights Select your music using discord's new select menu feature,

Forbidden A 0 Dec 19, 2021
A Discord bot for sending GeoGuessr challenge links that uses the GeoGuessr API written in rust.

GeoGuessr-bot-rs This is a simple implementation of a discord bot that send GeoGuessr-challenge links on demand. Features: Slash-commands Lightning-fa

Luukas Pörtfors 6 Nov 18, 2022
This is a Discord bot written in Rust to translate to and from the Bottom Encoding Standard using bottom-rs and Serenity.

bottom-bot This is a Discord bot written in Rust to translate to and from the Bottom Encoding Standard using bottom-rs and Serenity. Ever had this pro

Bottom Software Foundation 11 Dec 10, 2022
Chains - a bot written in Rust using the serenity crate

Chains (Rusty) Chains is a bot written in Rust using the serenity crate. Chains primarily focuses on easy to set up, easy to use moderation tools such

Quin 3 Mar 28, 2022
Autogenerated wrapper for the Telegram Bot API written in Rust.

An Elegant Rust Client for Telegram Bot API crates.io • docs.rs Table of contents Introduction Key Features Installation Getting Started Documentation

FerrisGram 22 Oct 29, 2022
A simple Telegram bot that eats anonymous channel messages, written in Rust.

tgbot-nochanmsg By Asuna Right Control When creating your bot from botfather, it's not bad to disable privacy mode, because it needs to access the mes

h3a.moe 2 Aug 5, 2022