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

Validation on market and position decimals in market proposals #2225

Open
davidsiska-vega opened this issue Mar 26, 2024 · 1 comment · Fixed by #2226
Open

Validation on market and position decimals in market proposals #2225

davidsiska-vega opened this issue Mar 26, 2024 · 1 comment · Fixed by #2226

Comments

@davidsiska-vega
Copy link
Contributor

Thanks to Jiajia we now have a feature test that can demonstrate that I can set up a market and drain someone’s monies by shifting price up slowly and then bringing it down quickly:
vegaprotocol/vega#10990

The problem is that the validation we have is market decimals >= asset decimals.
The validation we should have is: market decimals + position decimals >= asset decimals.

This would ensure that the smallest mark-to-market cashflow caused by the smallest price change on the smallest position is

10^(-mdp) x 10^(-pdp) = 10^(-(mdp+pdp)) >= 10^(-adp)

so it’s never possible to be in a situation where small price moves don’t register but big ones do.

@davidsiska-vega davidsiska-vega added this to the 🕌 Genbu Temple milestone Mar 26, 2024
@Jiajia-Cui
Copy link
Contributor

The problem is that the validation we have is market decimals <= asset decimals.
The validation we should have is: market decimals + position decimals <= asset decimals.

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 a pull request may close this issue.

3 participants