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

Feat/update pls feed to support puslechain mainnet & testnet #683

Merged
merged 5 commits into from
Jun 11, 2023

Conversation

johnny-vu
Copy link
Contributor

@johnny-vu johnny-vu commented Jun 8, 2023

This changes will support to get PLS/USD spot price on pulsechain mainnet (chainId: 369) & testnet (chainId: 943)

Summary

  • Add pulsechain chains.
  • Update pls_usd_feed, using PriceAggregator with multiple sources.
  • Remove pulsechain subgraph service.
  • Add test tests/feeds/test_pls_usd_feed.py

Steps Taken to QA Changes

  • Run the test:
tests/feeds/test_pls_usd_feed.py::test_pls_usd_median_feed
----------------------------------------------------------------------------------------------------------------------- live log call ------------------------------------------------------------------------------------------------------------------------
INFO     telliot_feeds.sources.price_aggregator:price_aggregator.py:91 Running median on [0.00011231, 0.00011237464510385463, 0.0001106946969326687]
INFO     telliot_feeds.sources.price_aggregator:price_aggregator.py:96 Feed Price: 0.00011231 reported at time 2023-06-09 16:32:36.502805+00:00
INFO     telliot_feeds.sources.price_aggregator:price_aggregator.py:97 Number of sources used in aggregate: 3
PASSED
  • Submit value:

https://scan.pulsechain.com/tx/0xee26f75be1672bbbcee33e657cd56ba017f05033634a0526fd1a75c3825a76da

Checklist

This pull request is:

  • A documentation error, docs update, or typographical error fix
    • No tests or issue needed
  • A code fix
    • Please reference the related issue by including "Closes <link to issue>" in this Pull Request's summary section.
      • If no issue exists, please create a bug report issue
    • Please include tests. Fixes without tests will not be accepted unless it's related to the documentation only.
    • Please make sure docs are updated if need be
  • A feature implementation
    • Please reference the related issue by including "Closes <link to issue>" in this Pull Request's summary section.
      • If no issue exists, please create a feature enhancement issue
    • Please include tests
    • Please make sure docs updates are both thorough and easy to reproduce by somebody with limited knowledge of the feature that you are submitting

Happy engineering!

@johnny-vu johnny-vu changed the title Draft: Feat/update pls feed to support puslechain mainnet & testnet Feat/update pls feed to support puslechain mainnet & testnet Jun 8, 2023
@johnny-vu johnny-vu marked this pull request as draft June 8, 2023 13:06
@akremstudy
Copy link
Collaborator

Hi @johnny-vu, thanks for making these prs, really cool to see. I'm curious why do you need to wait for multicall deployment, shouldn't it already be available by default in pulsechain since its already available in ethereum mainnet.

@johnny-vu
Copy link
Contributor Author

johnny-vu commented Jun 8, 2023

Hi @akremstudy, thanks for your feedback.

My apologies, I think the repo should be multicall.py

In my opinion, we can define multicall3 address in src/telliot_feeds/reporters/tips/__init__.py. However, I found this.
So I also think if we just update multicall to new version and that would be better to optimize the source code.

What do you think?

@akremstudy
Copy link
Collaborator

Hi @akremstudy, thanks for your feedback.

My apologies, I think the repo should be multicall.py

In my opinion, we can define multicall3 address in src/telliot_feeds/reporters/tips/__init__.py. However, I found this. So I also think if we just update multicall to new version and that would be better to optimize the source code.

What do you think?

Yeah thats the repo you're looking for, the banteg/multicall repo, thats where you want to make a pr to add the pulsechain network.
Updating the multicall package isn't going to make a difference until the pulsechain network is added to the multicall package but we can definitely circle back once thats the case and see if we can update the version without any issues.
In the meantime you can add the network in the init file to get up and running ie,

add_multicall_support(
    network="Pulsechain",
    network_id=369,
    state_override=False,
    multicall3_address="0xcA11bde05977b3631167028862bE2a173976CA11",
)

@johnny-vu
Copy link
Contributor Author

@akremstudy thank you. I'm clear for now.

I've submitted new PR is here and we'll see how it all goes.
Give me a few hours to update this PR according to your suggestion.

@akremstudy
Copy link
Collaborator

@akremstudy thank you. I'm clear for now.

I've submitted new PR is here and we'll see how it all goes. Give me a few hours to update this PR according to your suggestion.

Awesome!

@johnny-vu johnny-vu marked this pull request as ready for review June 10, 2023 10:12
@johnny-vu
Copy link
Contributor Author

Hi @akremstudy I've done this PR, could you please take a look?

Quick question, should I wait for telliot-core to release a new version and update setup.cfg before we can merge?

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.

Thanks @johnny-vu!

@akremstudy akremstudy merged commit 2c44ded into tellor-io:main Jun 11, 2023
@johnny-vu
Copy link
Contributor Author

Thanks @akremstudy!

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