Skip to content

Add RWA (SPOT) Trading skill - #1

Open
VibeCodeDaddy69 wants to merge 12 commits into
mainfrom
add-rwa-spot-trading-skill
Open

VibeCodeDaddy69 wants to merge 12 commits into
mainfrom
add-rwa-spot-trading-skill

Conversation

@VibeCodeDaddy69

Copy link
Copy Markdown
Owner

Summary

  • RWA Alpha — Real World Asset intelligence + spot trading skill
  • 198 tokens (15 native + 183 verified via OnchainOS) across 13 categories and 8 chains
  • Data-file-driven universe: rwa_universe.json (CSV-derived) + native_rwa.json (hand-maintained)
  • Categories: Treasury, Gold, DeFi Yield, RWA Gov, Yield Protocol, RWA Infra, RWA Credit, xStock, Ondo Tokenized, Stablestock, PreStocks, rStock, Leveraged ETF

Features

  • Tiered price polling (60s/5min/30min) with bulk initial fetch
  • Category-based macro playbook with dynamic target resolution
  • has_nav field for NAV premium/discount arbitrage (treasury/gold tokens)
  • Three-way exit logic: NAV exit, equity TP/SL, governance TP/SL
  • Treemap heatmap sized by 24H volume or market cap (toggle)
  • Animated globe network visualization with 13 category rings
  • Apple Liquid Glass legend design
  • Token logos from OnchainOS (59/198 tokens)
  • Live price feeds: price, mcap, liquidity, volume, 24h change

Files

File Description
rwa_alpha.py Main bot: perception → cognition → execution loop
config.py Strategy params, chain config, JSON universe loader
dashboard.html Full dashboard: globe, treemap heatmap, token universe table
data/rwa_universe.json 183 verified CSV tokens with logos
data/native_rwa.json 15 hand-maintained native RWA tokens
data/rwa_tokens.csv Source CSV (2,257 rows)
scripts/build_universe.py ETL: CSV → JSON merge script
plugin.yaml Claude Code plugin manifest
SKILL.md Skill documentation

Test plan

  • python3 scripts/build_universe.py generates 183-token JSON
  • python3 rwa_alpha.py starts, logs "198 tokens loaded"
  • GET /api/universe returns 198 tokens with categories and logos
  • GET /api/state returns price data for ~40+ tokens
  • Dashboard globe shows 13 category rings
  • Heatmap treemap toggles between Volume and Mcap sizing
  • Token universe table shows logos, prices, and search/filter

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

Phase 4: Summary + Pre-flight for rwa-spot-trading

Review below. AI Code Review is in a separate check.


Auto-injected Pre-flight
## Pre-flight Dependencies (auto-injected by Plugin Store CI)

> Run once per session before first use. These checks ensure required tools are installed.

### Version check (auto-injected)

> **AI Agent Instruction**: Run this version check before executing any commands from this skill. If an update is applied, re-read this SKILL.md before proceeding — the instructions may have changed.

```bash
# Check for skill updates (1-hour cache)
UPDATE_CACHE="$HOME/.plugin-store/update-cache/rwa-spot-trading"
CACHE_MAX=3600
LOCAL_VER="1.1.0"
DO_CHECK=true

if [ -f "$UPDATE_CACHE" ]; then
  CACHE_MOD=$(stat -f %m "$UPDATE_CACHE" 2>/dev/null || stat -c %Y "$UPDATE_CACHE" 2>/dev/null || echo 0)
  NOW=$(date +%s)
  AGE=$(( NOW - CACHE_MOD ))
  [ "$AGE" -lt "$CACHE_MAX" ] && DO_CHECK=false
fi

if [ "$DO_CHECK" = true ]; then
  REMOTE_VER=$(curl -sf --max-time 3 "https://raw.githubusercontent.com/okx/plugin-store/main/skills/rwa-spot-trading/plugin.yaml" | grep '^version' | head -1 | tr -d '"' | awk '{print $2}')
  if [ -n "$REMOTE_VER" ]; then
    mkdir -p "$HOME/.plugin-store/update-cache"
    echo "$REMOTE_VER" > "$UPDATE_CACHE"
  fi
fi

REMOTE_VER=$(cat "$UPDATE_CACHE" 2>/dev/null || echo "$LOCAL_VER")
if [ "$REMOTE_VER" != "$LOCAL_VER" ]; then
  echo "Update available: rwa-spot-trading v$LOCAL_VER -> v$REMOTE_VER. Updating..."
  npx skills add okx/plugin-store --skill rwa-spot-trading --yes --global 2>/dev/null || true
  echo "Updated rwa-spot-trading to v$REMOTE_VER. Please re-read this SKILL.md."
fi

Install onchainos CLI + Skills (auto-injected)

# 1. Install onchainos CLI
onchainos --version 2>/dev/null || curl -fsSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh

# 2. Install onchainos skills (enables AI agent to use onchainos commands)
npx skills add okx/onchainos-skills --yes --global

# 3. Install plugin-store skills (enables plugin discovery and management)
npx skills add okx/plugin-store --skill plugin-store --yes --global

Report install (auto-injected, runs once)

REPORT_FLAG="$HOME/.plugin-store/reported/rwa-spot-trading"
if [ ! -f "$REPORT_FLAG" ]; then
  mkdir -p "$HOME/.plugin-store/reported"
  # Device fingerprint → SHA256 → 32-char device ID
  DEV_RAW="$(hostname):$(uname -s):$(uname -m):$HOME"
  DEV_ID=$(echo -n "$DEV_RAW" | shasum -a 256 | head -c 32)
  # HMAC signature (obfuscated key, same as CLI binary)
  _K=$(echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | base64 -d 2>/dev/null || echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | openssl base64 -d)
  HMAC_SIG=$(echo -n "${_K}${DEV_ID}" | shasum -a 256 | head -c 8)
  DIV_ID="${DEV_ID}${HMAC_SIG}"
  unset _K
  # Report to Vercel stats
  curl -s -X POST "https://plugin-store-dun.vercel.app/install" \
    -H "Content-Type: application/json" \
    -d '{"name":"rwa-spot-trading","version":"1.1.0"}' >/dev/null 2>&1 || true
  # Report to OKX API (with HMAC-signed device token)
  curl -s -X POST "https://www.okx.com/priapi/v1/wallet/plugins/download/report" \
    -H "Content-Type: application/json" \
    -d '{"pluginName":"rwa-spot-trading","divId":"'"$DIV_ID"'"}' >/dev/null 2>&1 || true
  touch "$REPORT_FLAG"
fi


</details>

---
*Generated by Plugin Store CI after maintainer approval.*

@github-actions

Copy link
Copy Markdown

📋 Phase 3: AI Code Review Report — Score: N/A/100

Plugin: rwa-spot-trading | Recommendation: 👤 Manual review required

🔗 Reviewed against latest onchainos source code (live from main branch) | Model: unavailable via Anthropic API | Cost: N/A

This is an advisory report. It does NOT block merging. Final decision is made by human reviewers.


❌ AI review FAILED (HTTP 401): x-api-key header is required. Request size: 921260 bytes, plugin content: 209430 bytes.


Generated by Claude AI via Anthropic API — review the full report before approving.

@github-actions

Copy link
Copy Markdown

❌ Phase 1: Structure Validation — FAILED

Linting skills/rwa-spot-trading...


thread 'main' (6318) panicked at src/submission/lint.rs:870:36:
end byte index 5640 is not a char boundary; it is inside '─' (bytes 5639..5642) of \`---
name: rwa-alpha
description: >
  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 tok\`[...]
note: run with \`RUST_BACKTRACE=1\` environment variable to display a backtrace

→ Please fix the errors above and push again.

This branch had an error being deployed

1 failed and 1 active deployments
ai-review — 233c0538 Deployed Apr 21, 2026 by VibeCodeDaddy69 via AI code review #1
summary-generation — 233c0538 Deployed Apr 21, 2026 by VibeCodeDaddy69 via AI Review + Summary #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant