-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
executable file
·59 lines (48 loc) · 1.1 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"github.com/novaprotocolio/amm-bots/algorithm"
"github.com/novaprotocolio/amm-bots/client"
"github.com/shopspring/decimal"
"os"
)
func main() {
botType := os.Getenv("BOT_TYPE")
switch botType {
case "CONST_PRODUCT":
startConstProductBot()
}
}
/*
Env checklist:
- BOT_PRIVATE_KEY
- BOT_QUOTE_TOKEN
- BOT_BASE_URL
- BOT_MIN_PRICE
- BOT_MAX_PRICE
- BOT_PRICE_GAP
- BOT_EXPAND_INVENTORY
- BOT_WEB3_URL
*/
func startConstProductBot() {
privateKey := os.Getenv("BOT_PRIVATE_KEY")
makerClient := client.NewNovaClient(
privateKey,
os.Getenv("BOT_BASE_TOKEN"),
os.Getenv("BOT_QUOTE_TOKEN"),
os.Getenv("BOT_BASE_URL"),
)
minPrice, _ := decimal.NewFromString(os.Getenv("BOT_MIN_PRICE"))
maxPrice, _ := decimal.NewFromString(os.Getenv("BOT_MAX_PRICE"))
priceGap, _ := decimal.NewFromString(os.Getenv("BOT_PRICE_GAP"))
expandInventory, _ := decimal.NewFromString(os.Getenv("BOT_EXPAND_INVENTORY"))
web3Url := os.Getenv("BOT_WEB3_URL")
bot := algorithm.NewConstProductBot(
makerClient,
minPrice,
maxPrice,
priceGap,
expandInventory,
web3Url,
)
bot.Run()
}