Skip to content

Fix/convert manipulation#188

Open
pocikerim wants to merge 64 commits intofrijo/release/PI-15from
fix/convert-manipulation
Open

Fix/convert manipulation#188
pocikerim wants to merge 64 commits intofrijo/release/PI-15from
fix/convert-manipulation

Conversation

@pocikerim
Copy link
Contributor

No description provided.

pocikerim and others added 30 commits January 1, 2026 15:04
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…esistance

- Shadow DeltaB: Use TWAP as baseline for overall DeltaB, apply only actual convert impact
  - beforeOverallDeltaB now uses overallCappedDeltaB (TWAP)
  - afterOverallDeltaB = TWAP + (spotAfter - spotBefore)
  - Cancels flash loan manipulation while preserving real trade impact

- Ratio-based penalty: Convert DeltaB-unit penalty to BDV-unit proportionally
  - stalkPenaltyBdv = (penaltyAmount / totalDeltaPImpact) * bdvConverted
  - Ensures fair penalty calculation regardless of unit differences

Note: testBeanToBeanConvertAffectDeltaB needs update to match new formula
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…alculation instead of proportional token share
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
pocikerim and others added 26 commits January 21, 2026 13:52
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Optimize convert gas by reusing pre-fetched deltaB and reserves acros…
@pocikerim pocikerim marked this pull request as ready for review February 14, 2026 15:52
@pocikerim pocikerim requested a review from fr1jo February 14, 2026 15:53
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.

2 participants