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

bug: Wrong signness in new API #2229

Closed
marcovc opened this issue Jan 1, 2024 · 2 comments · Fixed by #2240
Closed

bug: Wrong signness in new API #2229

marcovc opened this issue Jan 1, 2024 · 2 comments · Fixed by #2240
Labels
bug Something isn't working

Comments

@marcovc
Copy link
Contributor

marcovc commented Jan 1, 2024

Problem

A liquidityNet map in a concentrated pool should be a int->int (or maybe int->big_int). It can be negative too:

$ref: "#/components/schemas/TokenAmount"

Impact

Can lead to reverts because solvers have the wrong AMM state.

@marcovc marcovc added the bug Something isn't working label Jan 1, 2024
@fleupold
Copy link
Contributor

fleupold commented Jan 3, 2024

I think this is mainly a documentation bug. Looking at the dto, the type is actually signed

#[serde_as(as = "HashMap<DisplayFromStr, DisplayFromStr>")]
liquidity_net: HashMap<i32, i128>,

So it shouldn't lead to reverts.

@marcovc
Copy link
Contributor Author

marcovc commented Jan 3, 2024

Oh great, I thought these API docs were autogenerated. Closing.

@marcovc marcovc closed this as completed Jan 3, 2024
fleupold added a commit that referenced this issue Jan 3, 2024
Fixes #2229 (cf. discussion there on why this is correct)
sunce86 pushed a commit that referenced this issue Jan 6, 2024
Fixes #2229 (cf. discussion there on why this is correct)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants