Skip to content

v2.0.0-alpha.9 — TradeCpi fix + 13/13 tests passing

Pre-release
Pre-release

Choose a tag to compare

@outsmartchad outsmartchad released this 22 Feb 15:28
· 35 commits to agent-trading-infra since this release

What's New

TradeCpi EngineOverflow Fixed (Phase H breakthrough)

Root cause: The vAMM matcher's maxFillAbs was set to 0n, meaning the matcher literally couldn't fill any trade — it returned exec_size = 0 (zero-fill), which the engine rejected as size == 0 → RiskError::Overflow.

Fix: Updated default vAMM params to match the production app (percolator-launch/app/hooks/useVAMM.ts):

  • maxFillAbs: 10^17 (effectively unlimited, was 0)
  • mode: 0 (passive, was 1/vAMM)
  • tradingFeeBps/baseSpreadBps/maxTotalBps: 50/50/200 bps
  • liquidityNotionalE6: 10^13 ($10M notional)

Full Percolator Integration — All 13 devnet tests pass

Complete lifecycle tested end-to-end on Solana devnet:

  1. Create market (10-step with vAMM matcher) ✅
  2. Init user (trader account) ✅
  3. Deposit collateral ✅
  4. Push oracle price ✅
  5. Keeper crank ✅
  6. Open long position ✅ (was failing with EngineOverflow)
  7. Read market state ✅
  8. Find my position ✅
  9. Close position ✅
  10. Verify flat ✅
  11. Withdraw collateral ✅
  12. Close account ✅
  13. Discover markets ✅

Other changes

  • Updated vendored @percolator/core accounts.ts with all account specs
  • Added encodeCloseSlab, encodeAdminForceClose to vendored SDK
  • 18 adapter methods including teardown, adminForceClose, closeSlab
  • Updated README.md and docs/index.html with Percolator section
  • Removed debug logging from trade() method
  • Withdraw test reads actual remaining capital
npm install outsmart@2.0.0-alpha.9