Update Polymarket bot strategy documentation after code changes...
Synchronize strategy documentation with actual code implementation after changes.
Call this skill after modifying:
src/strategies/gabagool.py - Strategy logicsrc/client/polymarket.py - Order executionsrc/monitoring/order_book.py - Opportunity detectionsrc/config.py - Strategy configuration| File | Purpose |
|---|---|
docs/STRATEGY_ARCHITECTURE.md |
Code flow diagrams, implementation status, discrepancies |
docs/strategy-rules.md |
Trading rules, entry/exit conditions, configuration reference |
Read the actual code path and compare to the diagram in docs/STRATEGY_ARCHITECTURE.md:
# Check opportunity detection flow
grep -n "on_opportunity\|_queue_opportunity\|_process_opportunities" src/strategies/gabagool.py
# Check order execution flow
grep -n "execute_dual_leg_order\|place_order_sync" src/client/polymarket.py
Update the ASCII diagram if the flow has changed:
Opportunity Detection → Queue → Execution → Persistence
In docs/STRATEGY_ARCHITECTURE.md, update the Implementation Status section:
## Implementation Status
| Phase | Description | Status |
|-------|-------------|--------|
| 1 | Dynamic pricing with zero slippage | COMPLETE |
| 2 | Strategy-owned persistence | NOT STARTED |
...
Mark phases as:
COMPLETE - Fully implemented and testedIN PROGRESS - Partially implementedNOT STARTED - Planned but not implementedCompare docs/strategy-rules.md rules against actual code:
# Example: Check slippage policy
grep -n "slippage\|limit_price\|price_d" src/client/polymarket.py
# Example: Check position sizing
grep -n "num_pairs\|yes_amount\|no_amount" src/strategies/gabagool.py
Document any gaps in the Discrepancies section:
IMPLEMENTED - Code matches documentationGAP - Documentation describes feature not yet implementedCRITICAL GAP - Implementation differs from documented behaviorIf config options changed, update both files:
# Check actual config options
grep -n "GABAGOOL_" src/config.py
Update the Configuration Reference section in docs/strategy-rules.md.
Add entry to docs/strategy-rules.md changelog:
## Change Log
| Date | Change |
|------|--------|
| YYYY-MM-DD | Description of what changed |
After fixing a pricing bug:
# 1. Verify the fix in code
grep -n "limit_price\|price_d" src/client/polymarket.py
# 2. Update docs/STRATEGY_ARCHITECTURE.md
# - Update code flow diagram to show price passthrough
# - Mark Phase 1 as COMPLETE
# - Update discrepancies section
# 3. Update docs/strategy-rules.md
# - Update Risk Management > Slippage Protection
# - Add changelog entry for zero slippage policy
After updating documentation:
src/config.py# Files to update
docs/STRATEGY_ARCHITECTURE.md
docs/strategy-rules.md
# Files to reference (actual implementation)
src/strategies/gabagool.py
src/client/polymarket.py
src/monitoring/order_book.py
src/config.py