Skip to content

Conversation

@brunoguerios
Copy link
Member

@brunoguerios brunoguerios commented Dec 9, 2025

Closes #158

Main change

  • Add a think wrapper to balancer-maths to handle state and simulate sequential swaps
  • Add simulation data generation through testData bun run generate:simulator

More info can be found on readme files created both for the simulator and for simulation data generation flow.

I also added a fuzz_example to highlight how the tool could be used. It starts from a initial pool state and applies random swaps while checking how that affects invariant growth.

Let me know if you have any feedback ;)

@brunoguerios brunoguerios self-assigned this Dec 9, 2025
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondered if this needed support for hooks?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this, but it was kinda straightforward to support everything, so I did.

@brunoguerios
Copy link
Member Author

Quick heads up that balances are likely not being updated properly as this was not a requirement for balancer maths. I'm adding extra checks to make sure this is working as expected.

@brunoguerios
Copy link
Member Author

brunoguerios commented Dec 11, 2025

All balance updates are now being checked and the PR is ready for a new review.

Base automatically changed from hook-test-data to main December 15, 2025 19:12
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