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

Add storage for Bifrost LST oracles #999

Open
green-jay opened this issue Jan 23, 2025 · 1 comment
Open

Add storage for Bifrost LST oracles #999

green-jay opened this issue Jan 23, 2025 · 1 comment

Comments

@green-jay
Copy link
Contributor

green-jay commented Jan 23, 2025

Bifrost parachain (id 2030) will regularly push their prices to us via XCM (in a format we specify) and so we need to set up a place to store them.

emaOracle pallet can be used to store these values via a new extrinsic public fn emaOracle.update_bifrost_oracle( asset_a: Location, asset_b: Location: price: (u128, u128) where locations are defined from Hydration perspective and values to determine price are sourced from vTokenMinting.tokenPool and tokens.TotalIssuance storages on Bifrost parachain.

Permission to set/store these oracles should be set for Bifrost sibling account 7LCt6dFs6sraSg31uKfbRH7soQ66GRb3LAkGZJ1ie3369crq.

@jak-pan
Copy link
Contributor

jak-pan commented Jan 29, 2025

We already support different sources.

We can use source as Bifrost

pub fn add_oracle(origin: OriginFor<T>, source: Source, assets: (AssetId, AssetId)) -> DispatchResult {

And then we need to add manual update function which will be whitelisted to Bifrost.

We could potentially just skip the EMA part while doing the manual update and just not use it. Alternatively use it to build aggregate for security reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants