-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Telliot Conditional Reporting (tellor is stale / max price change) #726
Conversation
…o conditional-report bringing in pyth-usd-spot feed
click.echo("Reporter settings:") | ||
click.echo(f"Max tolerated price change: {percent_change * 100}%") | ||
click.echo(f"Value considered stale after: {stale_timeout} seconds") | ||
click.echo(f"Transaction type: {tx_type}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate
@click.option( | ||
"-pc", | ||
"--percent-change", | ||
help="Price change percentage for triggering a report. Default=0.01 (1%)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default 50% comment
async def get_telliot_feed_data(self, datafeed: DataFeed[Any]) -> Optional[float]: | ||
"""Fetch spot price data from API sources and calculate a value | ||
Returns: | ||
- Optional[GetDataBefore]: latest data from tellor oracle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should current data, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was my first try, butliquity backup
used getDataBefore, then I used the same so I could use the same typing. Any advantage to using getCurrentData?
tests/conftest.py
Outdated
@@ -159,7 +159,7 @@ def mumbai_test_cfg(): | |||
|
|||
@pytest.fixture(scope="function", autouse=True) | |||
def goerli_test_cfg(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this still say goerli?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left comments on minor things, otherwise lgtm. thanks, @0xSpuddy
Steps Taken to QA Changes
Local tests passing, and lots of sepolia testing.
This pull request is:
Where Tellor is used as a primary oracle,
telliot contitional
can be used as the reporter of last resort for minimum liveness / heartbeat. Additionally, a price change threshold can be set so that if telliot calculates a value that is a set percentage different from the current oracle value, a new value is automatically reported.