Loading...
Loading...
RWA Alpha v1.1 — Real World Asset Intelligence Trading Skill. NewsNow macro event detection + Polymarket probability confirmation + on-chain price action → auto-trade tokenized treasury/gold/yield/governance tokens via OKX DEX (onchainos CLI). Three modes: Yield Optimizer (conservative) / Macro Trader (balanced) / Full Alpha (aggressive). Multi-chain: Ethereum + Solana via Agentic Wallet TEE signing. Trigger: RWA, real world asset, tokenized treasury, gold token, USDY, OUSG, PAXG, ONDO, CFG, PENDLE, PLUME, OM, GFI, TRU, bIB01, yield rotation, macro trading, macro event, NAV premium, NAV discount, credit expansion, credit tightening.
npx skill4agent add okx/plugin-store rwa-alphaRisk Warning: This strategy trades real tokens on-chain. Capital loss may occur due to RWA liquidity risk, macro prediction errors, smart contract bugs, or slippage. Start in paper mode. Deploy live only with capital you can afford to lose.
RWAAlpha/
├── skill.md ← This file (AI agent instructions)
├── config.py ← All tunable parameters (edit this, not rwa_alpha.py)
├── rwa_alpha.py ← Strategy engine (DO NOT EDIT unless fixing bugs)
├── dashboard.html ← Web dashboard UI (http://localhost:3249)
├── .gitignore ← Excludes state/ and runtime files
└── state/ ← [auto-generated at runtime]
├── positions.json ← Open positions
├── trades.json ← Completed trade history
├── signals.json ← Signal log (last 200)
├── macro_events.json ← Detected macro events (last 100)
└── yield_snapshots.json ← Yield ranking snapshotsonchainos# Verify onchainos CLI
~/.local/bin/onchainos --version
# Verify wallet login (live mode only)
~/.local/bin/onchainos wallet status
~/.local/bin/onchainos wallet addresses --chain 1config.pyMODE = "paper""live"PAUSED = FalseSTRATEGY_MODE = "macro_trader"yield_optimizerfull_alphaTOTAL_BUDGET_USD = 1000BUY_AMOUNT_USD = 100ENABLED_CHAINS = ["ethereum"]"solana"RWA_MODERWA_STRATEGY_MODERWA_BUDGETRWA_BUY_AMOUNTRWA_CHAINSANTHROPIC_API_KEYLLM_ENABLED = TrueLLM_ENABLED = Falsecd /path/to/RWAAlpha && python3 rwa_alpha.pyhttp://localhost:3249┌────────────────────────────────────────────────────────────┐
│ RWA ALPHA v1.1 ENGINE │
├────────────────────────────────────────────────────────────┤
│ │
│ PERCEPTION LAYER (runs every CHAIN_POLL_SEC = 60s) │
│ ├─ Price Cache: onchainos token price-info / advanced-info│
│ ├─ NewsNow API: financial headlines from 3 sources │
│ │ └─ wallstreetcn, cls, jin10 │
│ ├─ Polymarket API: prediction market probabilities │
│ ├─ Gold price tracking: PAXG/XAUT price changes │
│ └─ Volume spike detection: vol/MC ratio on gov tokens │
│ │
│ COGNITION LAYER │
│ ├─ Macro Event Detection (3-layer) │
│ │ ├─ L1: keyword match (fast, free) │
│ │ ├─ L2: LLM confirm/override ambiguous (Haiku ~$0.005)│
│ │ ├─ L3: LLM classify unmatched RWA headlines │
│ │ └─ 15 event types in MACRO_PLAYBOOK │
│ ├─ Sentiment Scoring (keyword-based, news + on-chain) │
│ │ └─ 60% news weight + 40% on-chain weight │
│ ├─ Yield Ranking (alpha_score for asset-backed tokens) │
│ │ └─ NAV discount 30% + sentiment 25% + liquidity 25% │
│ └─ Signal Composition → risk gate → execute │
│ │
│ EXECUTION LAYER │
│ ├─ onchainos swap quote → onchainos swap swap │
│ ├─ onchainos wallet contract-call (TEE, requires user confirmation) │
│ ├─ Risk checks: daily limit, session stop, cooldown, │
│ │ position concentration, category limit, liquidity │
│ └─ Dual exit system: asset-backed vs governance tokens │
│ │
└────────────────────────────────────────────────────────────┘| Token | Category | Asset-Backed | Chains | Exit System |
|---|---|---|---|---|
| USDY | treasury | Yes | ETH, SOL | NAV premium/discount |
| OUSG | treasury | Yes | ETH | NAV premium/discount |
| sDAI | treasury | Yes | ETH | NAV premium/discount |
| bIB01 | treasury | Yes | ETH | NAV premium/discount |
| PAXG | gold | Yes | ETH | NAV premium/discount |
| XAUT | gold | Yes | ETH | NAV premium/discount |
| USDe | defi_yield | Yes | ETH | NAV premium/discount |
| ONDO | rwa_gov | No | ETH, SOL | TP/SL/Trailing |
| CFG | rwa_gov | No | ETH | TP/SL/Trailing |
| MPL | rwa_gov | No | ETH | TP/SL/Trailing |
| PENDLE | yield_protocol | No | ETH | TP/SL/Trailing |
| PLUME | rwa_infra | No | ETH | TP/SL/Trailing |
| OM | rwa_infra | No | ETH | TP/SL/Trailing |
| GFI | rwa_credit | No | ETH | TP/SL/Trailing |
| TRU | rwa_credit | No | ETH | TP/SL/Trailing |
yield_optimizermacro_traderfull_alpha| Event | Action | Target Tokens | Conviction |
|---|---|---|---|
| buy | USDY, OUSG, bIB01 | 0.60 |
| strong_buy | USDY, OUSG, ONDO, bIB01, PENDLE | 0.85 |
| rotate | sell ONDO/CFG/PLUME/OM/PENDLE → buy USDY | 0.70 |
| sell_risk | sell ONDO, CFG, MPL, PLUME, OM, GFI, TRU, PENDLE | 0.80 |
| buy | PAXG, XAUT | 0.75 |
| buy | OUSG, USDY, bIB01 | 0.70 |
| buy | PAXG, XAUT | 0.80 |
| sell_risk | sell PAXG, XAUT | 0.65 |
| buy | PAXG | 0.65 |
| buy | USDY, ONDO, PENDLE | 0.70 |
| buy | sDAI | 0.65 |
| buy | ONDO, CFG, MPL, PLUME, OM, GFI, TRU | 0.60 |
| sell_risk | sell ONDO, CFG, PLUME, OM | 0.75 |
| buy | GFI, TRU, MPL | 0.60 |
| sell_risk | sell GFI, TRU, MPL | 0.70 |
| Parameter | Default | Description |
|---|---|---|
| 6 | Max simultaneous positions |
| 25% | Max single token allocation |
| 50% | Max single category allocation |
| 10 | Daily trade limit |
| $50 | Cumulative loss → stop trading |
| 300s | Cooldown after loss |
| $200K | Min pool liquidity to enter |
| 50 | Don't buy if NAV premium > 50bps |
| 0.55 | Min signal conviction to trade |
| 1.0% | Buy slippage tolerance |
| 2.0% | Sell slippage tolerance |
# Price data
onchainos token price-info --chain ethereum --address <token_addr>
onchainos token advanced-info --chain ethereum --address <token_addr>
# Wallet
onchainos wallet status
onchainos wallet balance --chain <chain_idx>
onchainos wallet addresses --chain <chain_idx>
# DEX trading
onchainos swap quote --chain <chain> --from <stable> --to <token> --amount <raw>
onchainos swap swap --chain <chain> --from <stable> --to <token> --amount <raw> \
--slippage <pct> --wallet-address <addr>
# Transaction signing + broadcast
onchainos wallet contract-call --chain <chain_idx> --to <contract> --unsigned-tx <tx_data> # requires user confirmation
# Transaction confirmation
onchainos wallet history --tx-hash <hash> --chain <chain_idx>1501http://localhost:3249GET /api/state| Command | Description |
|---|---|
| Launch |
| Show positions, PnL, mode, detected events |
| Graceful shutdown (sends SIGINT) |
| Show current config.py settings |
| Read state/positions.json |
| Read state/trades.json |
| Read state/signals.json (last 200) |
| Read state/macro_events.json |
rwa_alpha.pyconfig.pyMODE = "live"PAUSED = Falsedex quote/swap--wallet-address--chaingold_selloffinteractive_setup()input()main()| Source | Safe Fields |
|---|---|
| onchainos token price-info | price, marketCap, volume24h, liquidity |
| onchainos swap quote | toAmount, priceImpact, route |
| onchainos wallet balance | balance, symbol |
| onchainos wallet addresses | address, chain |
| Google News RSS | title, link, pubDate |
| Polymarket API | question, probability |
| Dashboard /api/state | mode, strategy_mode, positions, trades, prices, signals |
onchainos wallet statusMODE = "live"paperPAUSED = TrueMODE = "live"PAUSED = Falseonchainos swap swaponchainos wallet contract-callBUY_AMOUNT_USDMAX_PORTFOLIO_USDSESSION_STOP_USDMAX_DAILY_TRADES