Skip to content
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

Merged
merged 24 commits into from
Dec 19, 2023

Conversation

0xSpuddy
Copy link
Contributor

Steps Taken to QA Changes

Local tests passing, and lots of sepolia testing.

This pull request is:

  • A feature implementation

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.

@0xSpuddy 0xSpuddy requested a review from akremstudy December 18, 2023 19:59
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}")
Copy link
Collaborator

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%)",
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should current data, right?

Copy link
Contributor Author

@0xSpuddy 0xSpuddy Dec 19, 2023

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?

@@ -159,7 +159,7 @@ def mumbai_test_cfg():

@pytest.fixture(scope="function", autouse=True)
def goerli_test_cfg():
Copy link
Collaborator

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?

Copy link
Collaborator

@akremstudy akremstudy left a 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

@0xSpuddy 0xSpuddy merged commit 84dec04 into main Dec 19, 2023
4 checks passed
@0xSpuddy 0xSpuddy deleted the conditional-report branch December 19, 2023 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants