Skip to content

fix(hsm): correct ArbitrageExecuted profit measurement#1480

Open
iamyxsh wants to merge 1 commit into
masterfrom
fix/hsm-arbitrage-profit-snapshot
Open

fix(hsm): correct ArbitrageExecuted profit measurement#1480
iamyxsh wants to merge 1 commit into
masterfrom
fix/hsm-arbitrage-profit-snapshot

Conversation

@iamyxsh

@iamyxsh iamyxsh commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

execute_arbitrage read the receiver's "initial" balance after the EVM
flash-loan call, which already settled the profit — so
ArbitrageExecuted.profit was always 0. Snapshot moved to before the call.

Funds unaffected; accounting/observability only. Fixes #1461.

Adds a regression test that fails on unpatched code and passes with the fix.

@iamyxsh iamyxsh requested a review from enthusiastmartin July 6, 2026 08:11
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Crate versions that have been updated:

  • pallet-hsm: v1.7.0 -> v1.7.1

Runtime version has not been increased.

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.

Bug: HSM: execute_arbitrage Profit Measurement Always Returns Zero

1 participant