Market Module – Notes and Review for Testnet #5
0xjrclassic-ui
started this conversation in
Scenarios
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
Before moving to testnet, we’ve collected a set of adjustments for the Market Module.
The goal is to keep swaps predictable, balances correct, and module behavior consistent across upgrades.
Math / Precision
Replaced missing Dec.TruncateInt64() with safe conversion.
Unified CalcBasePool and added clear rounding rules.
Why: Prevents drift in balances and odd results in large swaps.
Parameters
Fixing confirmed.
PRP capped at 30 blocks/day.
Why: Keeps pools within expected ranges and avoids extreme values.
Invariants
Blocked stable → stable swaps.
Corrected quorum removal.
Split 0.35% fee: 50% burn / 50% oracle.
Why: Ensures valid swaps, protects the module, and simplifies accounting.
State & Lifecycle
Added round-trip export/import tests.
Atomic transfers.
Burn of residual balances.
Why: Keeps module consistent through restarts and epoch changes.
Testing
Fuzz seeds made persistent.
Ongoing integration with simulated chains.
Coverage added for manipulated oracles, stale TWAP, and large swaps.
Why: Reproduces bugs and hardens against known attack paths.
CI / QA
Race detector integrated.
Linters and coverage checks enabled.
Why: Improves quality and reduces risk before deployment.
Conclusion
These fixes address the most critical issues identified so far.
Once validated on testnet, the Market Module should be reliable, with predictable swaps and balances, and resilient against common exploits.
Beta Was this translation helpful? Give feedback.
All reactions