-
Notifications
You must be signed in to change notification settings - Fork 60
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!: Integrate EMA oracle with Omnipool Hooks #534
Conversation
Crate versions that have been updated:
Runtime version has been increased. |
…X-node into feat/oracle-hooks
badfab2
to
8f62291
Compare
} | ||
|
||
fn on_hub_asset_trade(_: Origin, _: AssetInfo<AssetId, Balance>) -> Result<(), Self::Error> { | ||
Ok(()) | ||
fn on_hub_asset_trade(_: Origin, _: AssetInfo<AssetId, Balance>) -> Result<Weight, Self::Error> { |
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.
Is this triggered on every swap? Even on Asset <> Asset?
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.
on LRNA trade only.
…X-node into feat/oracle-hooks
… feat/oracle-hooks
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #534 +/- ##
==========================================
- Coverage 38.84% 38.65% -0.19%
==========================================
Files 62 66 +4
Lines 4240 4421 +181
==========================================
+ Hits 1647 1709 +62
- Misses 2593 2712 +119
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Note: We might want to optimize the weights in terms of the HDX liquidity change possible on trade (e.g. only doing it once per block). |
… feat/oracle-hooks
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.
Nitpicks but we can fix later just push the periods we need
Add the EMA oracle pallet to the runtime and ingest data by using the
OmnipoolHooksAdapter
.Motivation and Context
We want to have on-chain data that aggregates over timespans. E.g. aggregate trading volume over some time to change fees based on it.
How Has This Been Tested?
Includes an integration test.
Most of the tests are in the pallet and its corresponding math package.
Checklist:
SupportedPeriods