Skip to content

csabapinter/simplemm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary

Simple market making bot for experimentation.

  • limit orders are evenly distributed in a grid
  • only responsible for execution
  • strategy and risk comes from strategy_config.toml
    • not recommended without a proven strategy component updating the strategy
    • adjust ranges to introduce directional bias
    • adjust frequency for aggressiveness
    • adjust risk limits based on market conditions
  • only binance futures testnet and btcusdt is implemented

Strategy parameters in strategy_config.toml:

  • min_spread
    • minimum range to quote on both sides
    • distance from mid price in USD value
    • (should be switched to % in later versions)
  • max buy(sell) spread
    • the depth of limit orders can be adjusted separately for each side
    • distance from mid price in USD value
    • bias examples:
      • sideways + low volatility: symmetric ranges narrowly quoted
      • sideways + high volatility: symmetric ranges widely quoted
      • bullish bias: shallow buy range, deep sell range
      • bearish bias: shallow sell range, deep buy range
  • granularity
    • defines how many limit orders should be placed evenly between min spread and max spread
  • max buy(sell) side
    • value in btc
    • maximum total sum of limit orders for each side
    • if you just want to execute trades in one direction, set this to zero for the other side
  • max position size
    • value in btc
    • maximum amount of risk the bot can take in either direction
    • currently this applies for both sell and buy sides
  • update interval
    • update frequency in seconds, this is how frequently the bot refreshes the range it quotes
      • short interval means more aggressive execution, the bot will "chase" if it has directional bias
      • large update interval means more patience (e.g. because signal is weaker)
    • update interval amplifies or dampens the effect of volatility
      • high volatility with frequent update means price levels are both revisited and filled more frequently
      • low volatility and rare updates means the orders might not even get visited and filled.

Usage examples

  • averaging out from a large short position
    • set max_buy_side & max_sell_side to zero, set max position size to zero (to make sure no new trades are made)

Set up .env file with binance testnet credentials:

  • BINANCE_API_KEY=your_key
  • BINANCE_API_SECRET=your_secret

Planned features

  • make range definitions % based
  • allow more sophisticated input for execution
    • separate min range for both sides
    • non-linear grid (e.g. denser towards current price, sparser outwards)
  • introduce risk management features
  • make other markets configurable
  • integration with strategy and risk modules

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages