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: JIT orders not considered in total surplus endpoint #3089

Closed
sunce86 opened this issue Oct 28, 2024 · 0 comments · Fixed by #3090
Closed

bug: JIT orders not considered in total surplus endpoint #3089

sunce86 opened this issue Oct 28, 2024 · 0 comments · Fixed by #3090
Labels
bug Something isn't working

Comments

@sunce86
Copy link
Contributor

sunce86 commented Oct 28, 2024

Problem

Surplus capturing JIT orders do not contribute to the total surplus sum for an owner, on the endpoint https://api.cow.fi/docs/#/default/get_api_v1_users__address__total_surplus

Impact

Wrong value (less then actual) shown on the frontend.

To reproduce

Example owner:
https://explorer.cow.fi/address/0xbf8868b754a77e90ea68ffc0b5b10a7c729457e1
Total surplus calculated: 0

Expected behaviour

Total surplus > 0

Screenshots/logs

Screenshot 2024-10-28 at 11 56 33
@sunce86 sunce86 added the bug Something isn't working label Oct 28, 2024
sunce86 added a commit that referenced this issue Nov 5, 2024
# Description
Fixes #3089

# Changes
<!-- List of detailed changes (how the change is accomplished) -->

Includes orders from "jit_orders" to calculate the total surplus.

- [ ] Updated sql query.

## How to test
Executed manually the new query against prod db. Two things are
verified:
1.
https://explorer.cow.fi/address/0xbf8868b754a77e90ea68ffc0b5b10a7c729457e1
now returns non-zero surplus.
2. Regular owners surplus remains the same, so this change did not break
existing functionality.

Performance should be good since "jit_orders" table also has index on
owners.
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.

1 participant