Skip to content

fix: xrpl-py v3 MemoWrapper import error crashing agent#29

Open
Timwal78 wants to merge 19 commits into
mainfrom
claude/add-llm-optimization-files-Mhtwz
Open

fix: xrpl-py v3 MemoWrapper import error crashing agent#29
Timwal78 wants to merge 19 commits into
mainfrom
claude/add-llm-optimization-files-Mhtwz

Conversation

@Timwal78
Copy link
Copy Markdown
Owner

One-line fix — MemoWrapper doesn't exist in xrpl-py v3. Use Memo directly. This was causing the agent to crash on import before running a single line of business logic.


Generated by Claude Code

claude added 19 commits May 19, 2026 12:14
agent/sml_agent.py — full self-funding agent:
- Complete x402 payment loop: invoice → XRPL RLUSD → verify → call
- Collects: market_scan, council_verdict (IWM + top squeeze pick), IWM 0DTE
- Synthesizes with Claude Opus into structured market brief (JSON)
- Lists brief on Signal Marketplace (earns per read)
- Pushes to all webhook subscribers via /api/events/push
- Tracks P&L: RLUSD spent vs earned across all cycles
- Logs Agent Passport tier/discount after each cycle
- RUN_ONCE=true for GitHub Actions cron mode
- Blocking scheduler for Railway worker mode (5x/day, Mon-Fri ET)

agent/requirements.txt — anthropic, xrpl-py, requests, APScheduler

.github/workflows/agent.yml — GitHub Actions cron:
- 5 triggers/day aligned to market sessions (ET)
- 3 secrets: AGENT_XRPL_SEED, AGENT_XRPL_ADDRESS, ANTHROPIC_API_KEY

core/app.py — POST /api/events/push for agent broadcast to SSE+webhooks

https://claude.ai/code/session_01SfaW4MgaAeSmF8VhFxWHTX
- mcp_bp.py: 7 new tools (futures_create, futures_take, futures_browse,
  futures_leaderboard, settlement_create, settlement_browse,
  settlement_trigger) with full dispatch handlers. Tool count 16 → 23.
- .well-known/mcp.json: same 7 tools with full input_schema for AI agent
  discovery (Smithery, PulseMCP, Cursor, etc.)
- openapi.json + .well-known/openapi.json: 13 new paths covering all
  futures and settlement REST endpoints, with request/response schemas
  and Settlement + Futures tags.

https://claude.ai/code/session_01SfaW4MgaAeSmF8VhFxWHTX
- post_futures_position(): after every council verdict, agent stakes 0.01
  RLUSD on its own IWM prediction in the Signal Futures Market — agent now
  bets on its own calls and earns or loses based on accuracy
- trigger_pending_settlements(): after every cycle, agent scans all OPEN
  settlement contracts and triggers any whose condition is now met — keeps
  the settlement layer live even without dedicated callers
- Both wired into run_cycle() — agent is now a full ecosystem participant

https://claude.ai/code/session_01SfaW4MgaAeSmF8VhFxWHTX
…very

- Updated description to include Signal Futures Market and Conditional Settlement
- Added 7 new free_endpoint entries covering all futures and settlement routes
- Added signal_futures_market protocol block: min/max stake, auto-settle
  trigger, supported symbols, fee structure, custody model
- Added conditional_settlement protocol block: conditions list, endpoints,
  fee, custody model, max contracts

AI agents discovering this service via agents.json now have full context
to participate in the prediction market and settlement system.

https://claude.ai/code/session_01SfaW4MgaAeSmF8VhFxWHTX
Step 1: Engine alignment check — council vs scan vs options vs 0DTE
Step 2: Contradiction flags — explicit conflict detection across all engines
Step 3: Grade-A pick selection — requires scan score > 70 + council align + options confirm
Step 4: Confidence calibration — starts at council score, +/- based on confirmations and conflicts
Step 5: Key levels from hard 0DTE data only (gamma_flip, max_pain) — never invented

Output now includes: engine_alignment, conflict_flags, continuation_or_reversal,
graded top_picks with reasons, conviction_grade (A/B/C/STAND_ASIDE).

Futures: skip on STAND_ASIDE, stake 0.02 on grade-A vs 0.01 on grade-B.
Marketplace listing: embeds conviction grade, alignment, and conflict notes.
max_tokens 1024 → 2048 to give Opus room to actually reason.

https://claude.ai/code/session_01SfaW4MgaAeSmF8VhFxWHTX
- push_discord(): formats brief as Discord embed with color-coded bias
  (green/red/yellow), regime emoji, conviction grade emoji, graded top picks,
  IWM key levels, conflict flags, actionable, and marketplace link
- DISCORD_WEBHOOK_URL env var — optional, silent if not set
- agent.yml: added DISCORD_WEBHOOK_URL secret passthrough
- Fires after every cycle, before SqueezeOS webhook push

Setup: Discord channel → Edit → Integrations → Webhooks → New Webhook → Copy URL
Add as GitHub secret DISCORD_WEBHOOK_URL — zero other config needed.

https://claude.ai/code/session_01SfaW4MgaAeSmF8VhFxWHTX
402proof/internal/base/verify.go (new):
  - Base chain JSON-RPC client
  - VerifyUSDCPayment(): queries eth_getTransactionReceipt, parses ERC-20
    Transfer event logs, verifies to=Ghost Layer ETH, amount >= invoice amount
  - No custom contract needed — works with any standard wallet

402proof/internal/invoice/invoice.go:
  - NewBase(): USDC/Base invoice with Ghost Layer ETH as pay_to,
    network="Base", asset="USDC", same price (1:1 USD peg with RLUSD)

402proof/cmd/server/main.go:
  - New env vars: GHOST_LAYER_ETH_ADDRESS, BASE_RPC_URL, USDC_CONTRACT_ADDRESS
  - POST /v1/invoice: optional currency="USDC" returns Base invoice;
    all invoices show all payment_options including USDC when enabled
  - POST /v1/verify: 0x prefix → Base verifier; XRPL path unchanged
  - GET /health: exposes Base network config when USDC rail is enabled

Activation: set GHOST_LAYER_ETH_ADDRESS in 402Proof Render env vars.
Ghost Layer already has the Base infrastructure. Zero new secrets for agents.

https://claude.ai/code/session_01SfaW4MgaAeSmF8VhFxWHTX
llms.txt: full 3-rail payment flow docs (RLUSD/XRPL, USDC/Base, XAH/Xahau)
  with exact steps for each rail — agents know exactly how to pay with USDC

index.html: title + description + keywords + mcp-payment-asset meta tag
  now includes USDC, Base chain, EVM wallet, MetaMask — crawlers index it

.well-known/mcp.json: payment.rails[] array with all 3 networks, USDC
  contract address, chain_id 8453, invoice_param hint for each rail

No sitemap change needed — no new URLs.

https://claude.ai/code/session_01SfaW4MgaAeSmF8VhFxWHTX
…RIToken, Xahau HookParams, XAHAU_MINT_CONFIRMED SSE
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.

2 participants