osmosis
osmosis copied to clipboard
Call to GetArithmeticTwap with wrong order of arguments
System information
Osmosis version: main (at time of writing)
OS & Version: n/a
Commit hash: 8a19d8b3edb53c18c2607750ac8e9b5b3b37e71b
Expected behaviour
All callers of this function provide the base asset followed by the quote asset
https://github.com/osmosis-labs/osmosis/blob/8a19d8b3edb53c18c2607750ac8e9b5b3b37e71b/x/twap/api.go#L31-L38
Actual behaviour
Some callers under wasmbinding/queries.go call the function with quote asset followed by base asset
https://github.com/osmosis-labs/osmosis/blob/8a19d8b3edb53c18c2607750ac8e9b5b3b37e71b/wasmbinding/queries.go#L122
and
https://github.com/osmosis-labs/osmosis/blob/8a19d8b3edb53c18c2607750ac8e9b5b3b37e71b/wasmbinding/queries.go#L140
Steps to reproduce the behaviour
n/a
Backtrace
n/a
Oh good catch! Thanks for this issue, we should be solving this by the next upgrade. Meanwhile, querying via correct arguments should be able to be done via stargate queries instead of bindings
I don't know how problematic this is, but I noticed that the order is incorrect in the unit tests as well. And if the order is switched to base, quote some unit tests start failing.
https://github.com/osmosis-labs/osmosis/blob/8a19d8b3edb53c18c2607750ac8e9b5b3b37e71b/x/twap/api_test.go#L329-L331
I believe this is now solved. Closing for now. Thank you @migueldingli1997
Actually, this is not solved. I mistook it for another refactor we did. Keeping open until further investigations
@mattverse seeing that you are assigned here. Any updates on this? I'm still seeing some twap tests having assets misplaced