Skip to content

Comments

Feature/market liquidity query#1

Merged
utilityjnr merged 66 commits intomainfrom
feature/market-liquidity-query
Feb 22, 2026
Merged

Feature/market liquidity query#1
utilityjnr merged 66 commits intomainfrom
feature/market-liquidity-query

Conversation

@utilityjnr
Copy link
Owner

Netwalls#69 close

BoxMeOut Developer and others added 30 commits February 19, 2026 15:39
- Add get_market_liquidity() function to query YES/NO reserves from AMM pool
- Calculate k constant (CPMM invariant: x * y = k)
- Return implied odds in basis points (5000 = 50%)
- Add query_amm_pool_state() helper for pool data retrieval
- Resolve merge conflicts in market.rs
- Add 12 comprehensive unit tests covering:
  * No pool scenario
  * Balanced and skewed pools
  * Extreme scenarios (95/5 splits)
  * Edge cases (one-sided reserves)
  * Large number handling
  * Rounding edge cases
  * K invariant verification
  * Read-only consistency

Closes #[issue-number] - Query current YES/NO liquidity from AMM pool
- Add comprehensive PR description with all acceptance criteria
- Add implementation summary document
- Fix merge conflicts in factory_test.rs
…t resolution

- Add finalize_resolution function to oracle contract
- Validates consensus reached and 7-day dispute period elapsed
- Makes cross-contract call to Market.resolve_market()
- Stores final outcome permanently
- Emits ResolutionFinalized event
- Add 4 integration tests with Market contract
- Add testutils feature for multi-contract testing
- Fix test warnings
- Merge main branch changes (resolve_market, claim_winnings implementations)
- Keep get_market_liquidity implementation from feature branch
- Resolve conflicts in market.rs and market_test.rs
- All liquidity query tests preserved
…t resolution (Netwalls#138)

- Add finalize_resolution function to oracle contract
- Validates consensus reached and 7-day dispute period elapsed
- Makes cross-contract call to Market.resolve_market()
- Stores final outcome permanently
- Emits ResolutionFinalized event
- Add 4 integration tests with Market contract
- Add testutils feature for multi-contract testing
- Fix test warnings

Co-authored-by: Stephanie Nwankwo <63151237+GoSTEAN@users.noreply.github.com>
…ity-query

feat: implement market liquidity query with k constant and implied odds
Adds 4 load test scenarios covering API baseline latency, 1000 concurrent
WebSocket connections, 100 simultaneous predictions burst, and AMM
high-frequency trading at 200 tx/sec. Includes shared config, auth
helpers, orchestrator script, npm scripts, and baseline metrics template.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Confirmed get_market_liquidity function is fully implemented in market.rs
- Returns YES/NO reserves, k constant, and implied odds
- Comprehensive unit tests covering all edge cases
- Resolved merge conflicts in factory_test.rs
- Added conflict resolution summary documentation

Acceptance Criteria Met:
✅ Return current YES/NO liquidity from AMM pool
✅ Return k constant and implied odds
✅ Unit tests with 12 comprehensive test cases
- Removed stray merge conflict markers (=======, >>>>>>> origin/main) at line 1103
- This was causing CI build failure with 'expected item, found ==' error
- All test functions are now properly closed
feat: add k6 load testing suite for performance benchmarks
- Add multi-sig requirement (configurable, default 2 of 3 admins)
- Implement emergency_override() function to override any market outcome
- Add cooldown period (default 24h, minimum 1h) to prevent rapid-fire overrides
- Emit EmergencyOverride event with justification hash for transparency
- Store complete override records for audit trail
- Add admin management functions (add_admin_signer, set_required_signatures, set_override_cooldown)
- Add query functions (get_override_record, is_manual_override, get_admin_signers, etc.)
- Implement 23 comprehensive unit tests covering all scenarios
- Add complete documentation (feature docs, implementation summary, quick reference)

Security features:
- Multi-signature validation with configurable threshold
- Cooldown period enforcement between overrides
- Complete audit trail with permanent records
- Justification hash requirement for transparency
- Admin authentication and validation
- No duplicate approvers allowed
- Outcome validation (0 or 1 only)
- Market existence verification

Priority: P0 - Critical - Safety mechanism
Status: Complete and tested
- Add ADMIN_SIGNERS_KEY, REQUIRED_SIGNATURES_KEY, LAST_OVERRIDE_TIME_KEY, OVERRIDE_COOLDOWN_KEY constants
- Add EmergencyOverrideRecord and OverrideApproval structs
- Fix emergency_override function signature with correct parameters
- Resolve all compilation errors
Ndifreke000 and others added 29 commits February 21, 2026 14:46
…-contract

Dispute market in market contract
- Poll AMM odds every 5 seconds

- Broadcast to subscribers on change > 1%

- Include direction indicator (YES/NO)
…rride-multisig

Feature/emergency override multisig
[Backend] Implement structured logging
[Backend] Extend health check endpoints
- Test complete flow: create → pool init → trade → close → resolve → settle
- Real PostgreSQL database integration via Docker
- Balance verification at each step
- Automated test runner script
- All tests passing
[Contract] Implement Oracle read-only query functions
…realtime-odds-broadcasting

feat: implement WebSocket real-time odds broadcasting (Netwalls#113)
feat: Created Soroban contract deployment script
@utilityjnr utilityjnr merged commit ac4b2db into main Feb 22, 2026
1 check passed
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.

9 participants