feat: ML-powered pricing agent with online learning#25
Merged
Conversation
abhicris
added a commit
that referenced
this pull request
Apr 23, 2026
Three fixes to make the CI on PR #25 (ML pricing agent) green: 1. **contracts** — `npm ci` failed with "no package-lock.json". The `deploy/` wrapper also couldn't find contracts since hardhat paths defaulted to `deploy/contracts/` which doesn't exist. Moved `package.json` + `hardhat.config.js` to repo root, committed `package-lock.json`, set `paths.sources = "./contracts"` + `paths.tests = "./tests/contracts"`, bumped solc to 0.8.26 with cancun evm (OZ ^5.0.0 uses `mcopy`). Workflow no longer needs `working-directory: deploy`. 2. **python / pytest-asyncio** — Three async message-handling tests for the WebSocket feed failed with "async def functions are not natively supported". Added `pytest-asyncio>=0.23.0` to requirements.txt and shipped `pytest.ini` with `asyncio_mode = auto`. 3. **test_unknown_pair_raises** — `patch.object(oracle, "w3")` eagerly invoked the property getter during setup, which tried to connect to `http://localhost:8545` and raised `OracleConnectionError` before the real assertion ran. The unknown-pair branch never needs `self.w3` — `_get_contract` raises `OracleFeedNotFound` before any RPC call. Dropped the patch. Local: - `npm ci && npx hardhat compile` → "Compiled 24 Solidity files successfully" - `pytest tests/` → 91 passed, 2 skipped (live-integration, correctly gated on WEB3_PROVIDER_URL_SEPOLIA). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds MLPricingAgent — a market-making agent that uses recursive least squares (RLS) online regression to predict short-term price direction and dynamically adjust spreads and skew. - Online linear model with exponential forgetting for non-stationarity - Feature extraction: returns, volatility, momentum, inventory ratio - Volatility-adaptive spread width + ML-confidence-weighted skew - Inventory-aware bid/ask adjustment - 10 tests covering spread dynamics, inventory skew, rebalancing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6c562d2 to
6299362
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MLPricingAgent— market-making agent with online machine learningTest plan
🤖 Generated with Claude Code