A trading bot for cryptocurrency which aims to be fast. Only support FTX exchange for now.
- Golang versions: 1.14 up
Steps:
- Install GVM
$ zsh < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
- Install Go on Mac
# Install Go using binary
$ gvm install go1.15 -B
$ gvm use go1.15
- Download related pacakges
$ go mod download
$ go run main.go
- Reference:
$ # binary will be $(go env GOPATH)/bin/air
curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
# Run air with your config. If file name is `.air.toml`, just run `air`.
$ air
# prints all logs
$ air -d
Rename config.json.example
file to config.json
and fill in the following configurations:
bots
: An array of bot instanceowner
: Name of the bot ownerkey
: API key generated from FTX exchangesecret
: API secret generated from FTX exchangesubAccount
: Sub-account in FTX exchangetelegramId
: User's telegram room id of the bot chat room to provide personal trading information. If provided,owner
should match the telegram user name.strategy
: Strategy of the bot. Currently the available values are"fr_arbitrage"
and"res_trend"
.
mode
: mode for running the program. Available values are"trade"
,"notify"
and"backtest"
.- Trade mode is for actual trading with the strategy, which means
key
andsecret
must be provided for every bot. - Notify mode is for simulation and notification. No actual trade will happen.
- Backtest mode is for backtesting with historical price data.
- Trade mode is for actual trading with the strategy, which means
notify
: Control whether to send notification or not.line
: Line bot configuration.telegram
: Telegram bot configuration. Just put the bot API token here.sentry
: Sentry DSN configuration. Just put the DSN URL here.