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

chore: More detailed logs why an order got filtered out #2886

Closed
MartinquaXD opened this issue Aug 13, 2024 · 1 comment
Closed

chore: More detailed logs why an order got filtered out #2886

MartinquaXD opened this issue Aug 13, 2024 · 1 comment
Assignees

Comments

@MartinquaXD
Copy link
Contributor

Background

Orders where the user doesn't have the required "effective balance" get filtered out. The effective balance here means min(token_allowance, token_balance) because the settlement contract can only spend this much money of the user.

At the moment we don't differentiate between missing balances and missing allowances and always report insufficient_balance.

Details

It would be nice to make the SolvableOrdersCache aware of allowance, balance and effective_balance to improve the logs.

Implementation suggestions:
Make BalanceFetching::get_balances() return what's currently account_balances::simulation::Simulation which already contains all the necessary information.
Change solvable orders cache to filter based on effective_balance and either report insufficient_balance or insufficient_allowance based on the respective values (balance should have higher prio).
In term of order_events I would still only store insufficient_balance to not over-complicate this in the DB.

Copy link

This issue has been marked as stale because it has been inactive a while. Please update this issue or it will be automatically closed.

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.

2 participants