Repository navigation
Conversation
…nd execution algorithms Implements four interconnected features for production-grade agent accountability and safe trading: 1. Trace Availability Monitor (OracleDesk#116) - Enumerates all published traces from the registry - Probes CIDs through multiple independent gateways - Verifies bytes against on-chain hash - Re-pins from trusted archive when retrieval fails - Alerts on genuinely unrecoverable traces - Persists state for incremental scans under RPC rate limits 2. Agent Budget Ledger for Paid Signal Purchases (OracleDesk#115) - Separate spending key for agent purchases (never treasury key) - Crash-safe daily budget with optional on-chain cap - Verifies OracleDesk trace purchases against reasoning-registry hash - Records paid inputs by hash and source without embedding content - Supports multiple gateways and archive re-pinning 3. Decision Replay and Audit CLI (OracleDesk#114) - agents/bin/audit.ts: re-derives agent actions from published traces - Fetches on-chain record and trace content via IPFS - Verifies hash and re-executes recorded strategy on recorded inputs - Compares re-derived decision with recorded decision and on-chain effect - Generates signed, machine-readable audit reports - Supports tracing individual decisions or all traces for a market 4. Execution Algorithms for Trade Slicing (OracleDesk#113) - TWAP executor: uniform time-weighted average price across ledgers - Participation-limited executor: adaptive slicing respecting market impact - Parent orders with target outcome, max collateral, and limit price - Re-quotes on-chain before each child order submission - Sets tight per-child min_shares_out respecting treasury caps - Crash-safe state persistence for mid-execution recovery - Adaptive stopping when edge disappears All modules include comprehensive tests and are designed for crash-safety, observability, and seamless integration with existing agent runtime.
|
@ada-nwali Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Implements four interconnected features to establish production-grade accountability, safety, and observability for agent trading and trace management on OracleDesk.
Issue #116: Trace Availability Monitor
Issue #115: Agent Budget Ledger for Paid Signal Purchases
Issue #114: Decision Replay and Audit CLI
Issue #113: Execution Algorithms for Large Trade Slicing
Feature Overview
1. Trace Availability Monitor (#116)
File:
oracledesk-stellar/x402/trace-availability-monitor.tsEnumerates all published traces from the registry and probes their availability:
Usage:
2. Agent Budget Ledger for Paid Signal Purchases (#115)
File:
oracledesk-stellar/x402/agent-budget-ledger.tsEnables agents to safely buy paid signals within an on-chain-capped data budget:
Usage:
3. Decision Replay and Audit CLI (#114)
File:
oracledesk-stellar/agents/bin/audit.tsRe-executes agent decisions from published traces to verify accountability:
Usage:
Report format:
{ "reportId": "abc123def456", "entries": [ { "traceId": "12345", "verdict": "match", "recordedDecision": { "action": "buy", "amount": "100" }, "reDerivedDecision": { "action": "buy", "amount": "100" }, "onChainEffect": { "txHash": "...", "amount": "100" } } ], "summary": { "totalTraces": 100, "matchedCount": 98, "deviationCount": 2, "mismatchCount": 0 } }4. Execution Algorithms for Trade Slicing (#113)
File:
oracledesk-stellar/agents/core/execution-algorithms.tsSlices large parent orders into child orders across ledgers with tight risk control:
TWAP Executor:
min_shares_outderived from fresh quote minus slippageParticipation-Limited Executor:
Usage:
Key Design Decisions
Testing
All modules include comprehensive unit tests:
trace-availability-monitor.test.tsagent-budget-ledger.test.tsexecution-algorithms.test.tsRun tests with:
npm testIntegration
These features integrate seamlessly with existing systems:
TraceRepositoryimplementationCloses #116
Closes #115
Closes #114
Closes #113