Skip to content

fix: price impact net before - #516

Merged
essserrr merged 2 commits into
masterfrom
fix/price-impact-net-before
Sep 16, 2026
Merged

essserrr merged 2 commits into
masterfrom
fix/price-impact-net-before

Conversation

@essserrr

Copy link
Copy Markdown
Collaborator

No description provided.

essserrr and others added 2 commits September 17, 2026 07:26
…peration

netValuePriceImpact on an existing account was measured against the net
value the operation leaves behind. A large withdrawal shrank that base and
inflated the rate, and a full exit left none, so the rate silently became
the routed-output one. It is now measured against the account's net value
before the operation; the routed output stays the fallback where that base
is not positive.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PathLossRate gains absolutePriceImpact: the same loss the rates are
drawn from, as a TokenAmount of the market's underlying, negative for a
loss like the rates.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@essserrr
essserrr merged commit 42e8b91 into master Sep 16, 2026
2 checks passed
@essserrr
essserrr deleted the fix/price-impact-net-before branch September 16, 2026 23:36
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