Skip to content

Binance minimal trading bot with API to easily run, stop or schedule trading strategies. Build algorithms in Typescript with focus on best practices and painless developer experience.

License

ocignis/ocignis-bot

Repository files navigation

Ocignis Bot

CI CI-Deployment

Binance minimal trading bot with API to easily run, stop or schedule trading strategies.
Build algorithms in Typescript with focus on best practices and painless developer experience.

Features:

  • Minimal setup that can be extended 🔧
  • Spin it up with single command 🌀
  • Can be easily modified to work with any exchange or trading asset (currently setup to Binance)
  • Dockerized:
    • Instantly create multiple bot containers with different strategies parameters ⚡
    • Nodejs v18 Alpine multi-stage image build ~120 MB (created on every GitHub Release)
  • End-To-End type safety with TypeScript (Database <-> Bot <-> API <-> Frontend) - Always execute your trading strategies safe ✅
  • tRPC API for seamless frontend app integration
  • Optional Express.js REST API
  • Websocket implementation. Get every single trade in real time.
  • Implemented with Binance integration, but extendable for any crypto or stock exchange

Requirements

Running

Easily set up a local development environment with single command!

Bot:

  • clone the repo
  • rename file to dev.env and set env vars(create Binance API keys)
  • npm run dev 🚀 (apply database migrations if needed npm run db-migration-generate)

Run Ocignis React app to start, stop or schedule trading strategies.

Backtesting:

  • download market data (trades, klines, aggregates etc.) from Binance npm run backtest-download-data
  • seed database npm run backtest-seed-database
  • npm run backtest-run 🚀

Run backtest in:

  • terminal npm run backtest-run:

demo-v.mp4

Stack:

Commands

Command Description
prepare Setup git hooks with Husky (executes on npm install)
build-ocignis-shared Build and export tRPC types
dev Start bot and database
dev-changed-deps Build and start bot image
build Build bot
lint Lint whole repository
lint-fix Run lint fix
lint-staged-husky Run prettier and lint on staged files
tsc Run TypeScript compiler
test Run tests
test-watch Run tests in watch mode
format-lint Lint formatting with Prettier
format-fix Fix formatting with Prettier
commit Run Commitizen on staged file
clean Remove installed, generated and cached folders (node_modules, coverage etc.)
update-binance-backtest-file-data Download and update binance csv data files
update-binance-backtest-database Update database for backtesting
bot-backtest Run backtest
db-prisma-client-generate Generate Prisma client
db-migration-generate Generate migration
db-migration-run Run migration helper
db-migration-run-dev Run migration localy on dev
db-migration-run-prod Run migration on production
docker-dev Start bot localy on dev
docker-prod Start bot in production
docker-compose-run Start bot and database in docker containers
docker-compose-run-changed-deps Build bot image and start

About

Binance minimal trading bot with API to easily run, stop or schedule trading strategies. Build algorithms in Typescript with focus on best practices and painless developer experience.

Topics

Resources

License

Stars

Watchers

Forks