-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkeepyr_types.py
47 lines (35 loc) · 991 Bytes
/
keepyr_types.py
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
from abc import ABC, abstractmethod
from typing import Optional
from dataclasses import dataclass
from driftpy.types import MarketType
from driftpy.dlob.dlob_node import DLOBNode
MakerNodeMap = dict[str, list[DLOBNode]]
class Bot(ABC):
@abstractmethod
async def init(self):
pass
@abstractmethod
async def reset(self):
pass
@abstractmethod
async def start_interval_loop(self, interval_ms: Optional[int] = 1000):
pass
@abstractmethod
async def health_check(self):
pass
@dataclass
class BotConfig:
bot_id: str
@dataclass
class JitMakerConfig(BotConfig):
market_indexes: list[int]
sub_accounts: list[int]
market_type: MarketType
target_leverage: float = 1.0
spread: float = 0.0
@dataclass
class PerpFillerConfig(BotConfig):
filler_polling_interval: Optional[float] = None
revert_on_failure: bool = False
simulate_tx_for_cu_estimate: bool = False
use_burst_cu_limit: bool = False