-
Notifications
You must be signed in to change notification settings - Fork 170
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: multi-quote deviation logic #1110
Conversation
require.Equal(t, prices[pair.Base], atomPrice) | ||
} | ||
|
||
func TestGetComputedPricesCandlesConversion(t *testing.T) { |
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.
This & TestGetComputedPricesTickersConversion
are the test cases that don't work without this PR
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.
- For this kind of things, would be better if we firstly discuss the solution in the issue before coding (also would help with review)
- I'm not sure we should do aggregation between different pairs, because we dismiss arbitrage. Probably only 3-4 base pairs should be possible (USDT, BTC, USD, maybe Atom - and atom only allowed when we don't have other price with significantly better volume)
logger, | ||
convertedCandles, | ||
deviations, | ||
) |
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.
If we have less than 3 values, then we won't have a price. Is this desirable?
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 don't believe this is true - with 2 or less values we don't filter anything out due to deviation but we still have a price, because we can't calculate a meaningful standard deviation. Of course the best case is having 3+ values.
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.
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.
umee/price-feeder/oracle/filter.go
Line 115 in 4348c3e
// We accept any prices that are within (2 * T)𝜎, or for which we couldn't get 𝜎. |
Agreed, maybe ETH as well - but this should be addressed in another PR |
OK, but I don't want to release a price feeder without that update. Could you add followup issue? |
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.
utACK
Need to try and backport this to the price feeder release branch for some testnet support |
@Mergifyio backport release/price-feeder/v0.2.x |
* fix multi quote deviation logic * test++ * tests++ * cl++ * add reddit as a provider * tests++ * cl++ * moar tests * fix this test just a tiny bit * add the multi-quote test case * make tests less lenient * add another btc pair to test cases for deviation logic * cleanup * cleanliness * cleanup tests * compute tests * clear up some comments & change this to a feature Co-authored-by: Robert Zaremba <robert@zaremba.ch> (cherry picked from commit a85f6dd) # Conflicts: # price-feeder/CHANGELOG.md # price-feeder/oracle/oracle.go
✅ Backports have been created
|
1 similar comment
✅ Backports have been created
|
@Mergifyio backport release/price-feeder/v0.2.x |
✅ Backports have been created
|
1 similar comment
✅ Backports have been created
|
* feat: multi-quote deviation logic (#1110) * fix multi quote deviation logic * test++ * tests++ * cl++ * add reddit as a provider * tests++ * cl++ * moar tests * fix this test just a tiny bit * add the multi-quote test case * make tests less lenient * add another btc pair to test cases for deviation logic * cleanup * cleanliness * cleanup tests * compute tests * clear up some comments & change this to a feature Co-authored-by: Robert Zaremba <robert@zaremba.ch> (cherry picked from commit a85f6dd) # Conflicts: # price-feeder/CHANGELOG.md # price-feeder/oracle/oracle.go * remove some of this stuff Co-authored-by: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com>
This PR solves the issue for the price feeder wherein a validator might configure it to use these exchange rates to get the price of BTC/USD :
This case is specific to certain assets which have more exchange rates with other tokens than they do with stablecoins.
This PR also takes care of deviation detection for stablecoins before converting everything.
closes: #1083
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...