-
Notifications
You must be signed in to change notification settings - Fork 97
/
types.go
64 lines (54 loc) · 1.12 KB
/
types.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
60
61
62
63
64
package types
import (
"github.com/anthdm/hollywood/actor"
"time"
)
// message to cancel a trade
type CancelOrderRequest struct {
TradeID string
}
// message sent to get trade info
type TradeInfoRequest struct {
TradeID string
}
// response message for trade info
type TradeInfoResponse struct {
// info regarding the current position
// eg price, pnl, etc
Foo int
Bar int
Price float64 // using float in example
}
// message sent to create a new trade order
type TradeOrderRequest struct {
TradeID string
Token0 string
Token1 string
Chain string
Wallet string
PrivateKey string
Expires time.Time
}
// options when creating new price watcher
type PriceOptions struct {
Ticker string
Token0 string
Token1 string
Chain string
}
// price update from price watcher
type PriceUpdate struct {
Ticker string
UpdatedAt time.Time
Price float64
}
// subscribe to price watcher
type Subscribe struct {
Sendto *actor.PID
}
// unsubscribe from price watcher
type Unsubscribe struct {
Sendto *actor.PID
}
// used with SendRepeat to trigger price update
type TriggerPriceUpdate struct{}