Github Issue
Related Analysis
https://medium.com/@contact_91159/terra-sdr-arbitrage-and-cross-rate-calculation-a77bfee70ca0
Describe the bug
The state machine computes cross-exchange-rate from votes as below
- calculate median price for each Luna/Terra rates voted
- use the calculated median prices to calculate cross-rate
Problems
The current calculation mechanism does not accurately capture the cross-rateCurrently it is creating highly volatile cross-rate, resulting in creating very frequentcross-rate swap arbitrage opportunity which drains the network's asset
Suggested Solution
The state machine should be
- first calculate each implied cross-rate from each validator's votes
- derive the median of implied cross rates of each validator
- if one of the Luna/Terra rate is unavailable for a validator's votes, it is neglected during computation of median
Contribution Work Contents
- Complete codebase and document Pull Request on Github
- A test code to check the functionality of new cross-rate computation process
- A broad risk analysis report on instability of cross-rate oracle prices