feat: enable simplified BYC two-sided market flow#54
Conversation
Implement true two-sided BYC<>wUSDC.b execution with side-aware offer construction and quote-side buy bootstrapping, while simplifying market pricing config to fixed quote-per-base. This keeps CAT split fee behavior at zero and leaves clear side/pricing/inventory hook boundaries for future advanced models. Made-with: Cursor
Remove the temporary CAT split zero-fee override so coin-split uses the standard advised/config fallback fee path again, and update manager tests to match restored fee behavior. Made-with: Cursor
PR #54 Review -
|
Use the split target asset for buy-side bootstrap confirmation waits, avoid defaulting unknown active-offer side to sell, and restore validation of present strategy pricing fields for stable quote markets. Add regression tests for each reviewed path and clean duplicated test setup noise. Made-with: Cursor
|
Addressed the review feedback with follow-up commit Changes made
Validation
|
|
Thanks — bootstrap wait changes look solid (nice: explicit bootstrap_wait_failed + buy waits on quote asset, and tests cover it). One remaining correctness gap re: side accounting: _normalize_offer_side() returns 'sell' for anything except explicit 'buy', and _recent_offer_metadata_by_offer_id() normalizes item.get('side') through that. So malformed/missing side inside an existing metadata item still becomes sell (sell-biased fallback). That can undercount buys / skew two-sided planning over time. Also noticed manager-written strategy_offer_execution items in _build_and_post_offer_cloud_wallet(...) appear to omit 'side'; if those are later consumed for accounting, they’ll hit the same sell-default path. Request before full approve:
|
Treat malformed or missing side metadata as unknown/unmapped instead of sell-biased defaults, and ensure manager-written strategy_offer_execution items always include side when known. Add regression coverage for malformed side handling and manager audit-side persistence. Made-with: Cursor
|
Follow-up comment addressed in commit What changed
Tests added
Validation
|
|
Re-review after your follow-up (commit 845b38c): this addresses the remaining side-accounting concerns I called out.
Assuming CI passes the full suite, this looks good to me. |
Document the PR follow-up hardening commit and verification, including John-Deere fast-forward to 845b38c and daemon restart on that runtime revision. Made-with: Cursor
Cap daemon coin-op combine submissions at 5 inputs, add exponential backoff retries for Cloud Wallet 429 responses, and use capped progress combines in split prerequisites with explicit operator-facing notes. Made-with: Cursor
Update manager cloud-wallet polling and Dexie visibility validation flows, wire the adapter support they require, and refresh runbook and regression tests to match the new behavior. Made-with: Cursor
Move cloud-wallet offer posting and asset resolution out of manager internals so the daemon can share one runtime path, while keeping test seams intact. Also record the ent-wallet BYC query issue and add temporary client-side mitigations for scoped coin queries and sub-unit CAT coin operations. Made-with: Cursor
Reject non-1000 CAT unit multipliers during market config parsing and default missing CAT multipliers to the canonical 1000-mojo unit. This prevents host-specific config drift from silently mispricing CAT offers. Made-with: Cursor
Revalidate scoped CAT coin candidates by direct CoinRecord lookup before split or combine selection so cross-asset rows leaked by Cloud Wallet cannot be treated as spendable inventory. Record the live John-Deere evidence and note that this defense is temporary until the upstream scoped-query bug is fixed. Made-with: Cursor
Summary
buy/sellside through strategy planning, daemon execution, and cloud-wallet offer creationfixed_quote_per_base: 0.999, enable the market, and set config-driven 1-buy/3-sell size-10 targets with small buffersTest plan
PATH="$(pwd)/.venv/bin:$PATH" pytest -q tests/test_config_models.py tests/test_daemon_strategy_integration.py tests/test_manager_post_offer.py tests/test_daemon_offer_execution.py tests/test_strategy.pyPATH="$(pwd)/.venv/bin:$PATH" pre-commit run --all-filesMade with Cursor