-
Notifications
You must be signed in to change notification settings - Fork 9
Add price feed pallet #40
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
Conversation
willemolding
left a comment
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.
I'm having trouble building this locally and also I think there is a cargo fmt error.
New additions look great. Some more test would be good. The feed_creation_should_work is just a smoke test, we should probably at least test calling the get_price implementation. It would also be great to have test for the AssetPricePair methods.
willemolding
left a comment
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.
Looks great! Happy to merge once you have sorted out the dependency issues
Changes
Blocked by #39 because the substate-v3 chainlink feed depends on a newer substrate rococo revision
FeedOracleAssetPricePairtype to represent a base/quote price pairPirceFeedtrait to fetch asset pairsThe chainlink pallet is abstracted via theFeedOracletrait, the PINT price-feed pallet will be an additional abstraction on top of it. While the design for the price-feed isn't final, I believe we probably will need some storage items, therefor the price-feed will be a pallet instead of an additional trait that is implemented forFeedOracleThe
PriceFeedtrait is the intended abstraction on top the price feed palletNew prices are inserting into the designated feeds via the existing chainlink feed pallet; At this point it is assumed that all feeds, including the PINT price feed will use a common base currency (DOT).
The price feed pallet is configured with aPercisionwhich is applied to all price feeds, since feeds can have differentdecimals, a conversion will be required.Update:
Tests
Issues