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

fix: oracle RV audit feedback #617

Merged
merged 13 commits into from
Jun 26, 2023
Merged

Conversation

apopiak
Copy link
Contributor

@apopiak apopiak commented Jun 19, 2023

Various small improvements.

  • add Short period to all_periods
  • remove MAX_UNIQUE_ENTRIES and trades_estimation.py
  • rename timestamp field to updated_at and add constructor
  • add inverted function to Ratio
  • add some comments

@github-actions
Copy link

github-actions bot commented Jun 19, 2023

Crate versions that have been updated:

  • hydra-dx-math: v7.1.0 -> v7.2.0
  • pallet-ema-oracle: v1.0.3 -> v1.1.0
  • hydradx-traits: v2.3.1 -> v2.4.0

Runtime version has not been increased.

@apopiak apopiak changed the title Chore: Small Oracle Improvements chore: Small Oracle Improvements Jun 19, 2023
@dmoka
Copy link
Contributor

dmoka commented Jun 19, 2023

In the common package, there is an adapter called OraclePriceProviderAdapterForOmnipool, which implements the trait PriceOracle, used in DCA pallet.

This adapter gets the price for an arbitrary asset pair TKN1 - TKN2, by multiplying the results of nominators and denominators for TKN1-LRNA, LRNA-TKN2, resulting in TKN1 - TKN2 asset pair price.

I wonder whether we need to change something there due to this current PR. What do you think?

@mrq1911 mrq1911 changed the title chore: Small Oracle Improvements feat: oracle improvements Jun 22, 2023
@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Patch coverage: 78.26% and project coverage change: -0.03 ⚠️

Comparison is base (cdebe05) 64.66% compared to head (827683c) 64.63%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #617      +/-   ##
==========================================
- Coverage   64.66%   64.63%   -0.03%     
==========================================
  Files         130      130              
  Lines        9446     9450       +4     
==========================================
  Hits         6108     6108              
- Misses       3338     3342       +4     
Impacted Files Coverage Δ
math/src/ratio.rs 69.44% <0.00%> (-8.69%) ⬇️
traits/src/oracle.rs 56.89% <ø> (ø)
pallets/ema-oracle/src/types.rs 91.66% <90.90%> (ø)
pallets/ema-oracle/src/benchmarking.rs 98.75% <100.00%> (ø)
pallets/ema-oracle/src/lib.rs 87.91% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mrq1911 mrq1911 changed the title feat: oracle improvements fix: oracle RV audit feedback Jun 26, 2023
@mrq1911 mrq1911 merged commit 9a6cc6b into master Jun 26, 2023
7 checks passed
@apopiak
Copy link
Contributor Author

apopiak commented Jun 28, 2023

I wonder whether we need to change something there due to this current PR. What do you think?

As discussed offline, not applicable for this PR.

@apopiak apopiak deleted the apopiak/small-oracle-improvements branch June 28, 2023 13:42
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.

4 participants