Skip to content

fix liquidity distribution - #36

Open
rustydotwtf wants to merge 2 commits into
mainfrom
fix/liquidity-distribution
Open

fix liquidity distribution#36
rustydotwtf wants to merge 2 commits into
mainfrom
fix/liquidity-distribution

Conversation

@rustydotwtf

Copy link
Copy Markdown
Collaborator

instead of calculating reserves, fetch them directly w/ rpc

Fetch actual token balances from migration pool using balanceOf()
instead of calculating theoretical reserves from liquidity math.
This matches the approach used for V3 pools.
In V4 swap events, positive amounts = tokens in, negative = tokens out.
Reserves should be updated with addition (reserves + amount) not
subtraction, so that:
- tokens coming in (+) increase reserves
- tokens going out (-) decrease reserves
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.

1 participant