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

Audit Fix: prevent depositor or LP from creating unfair spreads #344

Merged
merged 8 commits into from
Nov 17, 2023

Conversation

jcompagni10
Copy link
Contributor

@jcompagni10 jcompagni10 commented Nov 1, 2023

Due to rounding in favor of the maker when trading against an LP or LO position
small amounts of liquidity can unfairly benefit the maker at the expense of the taker.

Unfortunately the obvious solutions of either preventing small deposits, or stopping takers from trading against these positions either do not work or create problematic DOS vectors.

Instead, we have switched our rounding logic to favor the taker. This also helps mitigate a number of existing DOS/dusting vectors. In order to protect makers, we also add a check as part of swap to prevent takers from swapping very small amounts where rounding would work significantly in their favor.

@jcompagni10 jcompagni10 changed the base branch from main to merge_duality_neutron November 1, 2023 20:45
@jcompagni10 jcompagni10 marked this pull request as draft November 9, 2023 22:18
@jcompagni10 jcompagni10 marked this pull request as ready for review November 10, 2023 23:35
@pr0n00gler pr0n00gler merged commit 75c2ec3 into merge_duality_neutron Nov 17, 2023
6 checks passed
@pr0n00gler pr0n00gler deleted the fix_deposit_spread branch May 9, 2024 18:16
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 this pull request may close these issues.

3 participants