-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfig.py
55 lines (45 loc) · 1.83 KB
/
config.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
48
49
50
51
52
53
54
55
from typing import List, Optional
import typed_settings as ts
@ts.settings
class CoinGeckoProduct:
# Symbol name. e.g., Crypto.BTC/USD
symbol: str
# The CoinGecko API ID for this product, used to query reference prices
coin_gecko_id: str
@ts.settings
class Pythd:
# The websocket endpoint
endpoint: str
@ts.settings
class CoinGeckoConfig:
# How often to poll CoinGecko for price information
update_interval_secs: int
# The confidence interval rate (to the price) in basis points to use for CoinGecko updates
confidence_ratio_bps: int
products: List[CoinGeckoProduct]
@ts.settings
class PythReplicatorConfig:
http_endpoint: str
ws_endpoint: str
first_mapping: str
program_key: str
staleness_time_in_secs: int = ts.option(default=30)
# Manual aggregation is aggregating the prices of the publishers and ignoring
# the min_publishers when aggregate price status is not TRADING. This will improve
# the feed uptime but reduces the accuracy of the feed. One benefit of this feature
# is mirroring coming soon feeds on the target network that have some beta publishers.
manual_agg_enabled: bool = ts.option(default=True)
# The maximum slot difference to consider a publisher for manual aggregation
# when the aggregate price status is not TRADING.
manual_agg_max_slot_diff: int = ts.option(default=25)
account_update_interval_secs: int = ts.option(default=300)
@ts.settings
class Config:
provider_engine: str
pythd: Pythd
health_check_port: int
health_check_threshold_secs: int
price_update_interval_secs: float = ts.option(default=1.0)
product_update_interval_secs: int = ts.option(default=60)
coin_gecko: Optional[CoinGeckoConfig] = ts.option(default=None)
pyth_replicator: Optional[PythReplicatorConfig] = ts.option(default=None)