generated from orcfax/python-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using the new validator on-demand endpoint we collect requests and send them to the validator in a single call.
- Loading branch information
1 parent
4c57584
commit 3826d82
Showing
2 changed files
with
112 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
"""Collection of feeds and price deviations to monitor for.""" | ||
|
||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass | ||
class Feed: | ||
name: str | ||
deviation: float = 2.0 # 2% default. | ||
|
||
|
||
feeds_to_monitor = [ | ||
# Feed names are always upper-case. | ||
Feed("ADA-USD", 1.0), | ||
Feed( | ||
"ADA-IUSD", | ||
), | ||
Feed( | ||
"ADA-USDM", | ||
), | ||
Feed( | ||
"ADA-DJED", | ||
), | ||
Feed( | ||
"SHEN-ADA", | ||
), | ||
Feed( | ||
"MIN-ADA", | ||
), | ||
Feed( | ||
"FACT-ADA", | ||
), | ||
Feed( | ||
"LQ-ADA", | ||
), | ||
Feed( | ||
"SNEK-ADA", | ||
), | ||
Feed( | ||
"LENFI-ADA", | ||
), | ||
Feed( | ||
"HUNT-ADA", | ||
), | ||
Feed( | ||
"IBTC-ADA", | ||
), | ||
Feed( | ||
"IETH-ADA", | ||
), | ||
] | ||
|
||
|
||
def get_deviation(feed_id: str): | ||
"""Retrieve deviation for a given price pair.""" | ||
for feed in feeds_to_monitor: | ||
if feed.name != feed_id: | ||
continue | ||
return feed.deviation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters