openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > Universal Trading

Execute cross-chain token trading on EVM and Solana with Particle Network Universal Account SDK. Use when users ask to set up universal-account-example, buy...

数据与表格

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v0.1.0

统计:⭐ 0 · 231 · 1 current installs · 1 all-time installs

0

安装量(当前) 1

🛡 VirusTotal :可疑 · OpenClaw :可疑

Package:0xmomo-ngclubs/universal-trading

安全扫描(ClawHub)

  • VirusTotal :可疑
  • OpenClaw :可疑

OpenClaw 评估

The skill's purpose (cross-chain trading) matches the scripts provided, but the package manifest declares no required credentials while the runtime scripts create/read a .env containing a private key and use embedded demo Particle credentials and network endpoints — this mismatch and the auto‑bind network behavior are unexpected and warrant caution.

目的

Name/description (cross-chain trading with Particle Network) is consistent with the included scripts (init, buy, check, ws monitoring, etc.). However the registry metadata claims no required environment variables or credentials while the runtime code clearly requires a PRIVATE_KEY and Particle project credentials (PROJECT_ID, PROJECT_CLIENT_KEY, PROJECT_APP_UUID) — the declared requirements are incomplete/incoherent.

说明范围

SKILL.md and scripts direct the agent to auto-run initialization (scripts/init.sh) that will generate or import a wallet, write a plaintext .env containing PRIVATE_KEY and project credentials, patch example code, run smoke tests, and auto-bind an invite code by making authenticated network calls to particle network API endpoints. The skill's instructions therefore perform filesystem writes, spawn Node.js processes, and call external endpoints …

安装机制

Install spec only offers installing Node.js via Homebrew (formula: node), which is reasonable given the scripts are Node-based. No arbitrary remote binary downloads or opaque installers are used.

证书

Registry lists no required env vars, but scripts require and/or create .env with PRIVATE_KEY and Particle project credentials and expect PROJECT_ID / PROJECT_CLIENT_KEY / PROJECT_APP_UUID. setup-wizard hardcodes demo PROJECT_* credentials in the script (embedded values), meaning the skill will by default configure and use those demo credentials unless the user replaces them. Storing a private key in a plaintext .env and using demo project keys…

持久

The skill does file-system changes inside a project directory (.env, patches to examples/*) and runs initialization scripts, but does not request platform-wide persistence (always: false) nor does it modify other skills. The auto-run guidance in SKILL.md suggests performing first-run initialization automatically; that behaviour modifies local files and calls external APIs and therefore should be explicitly permitted by the user before running.

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Universal Trading」。简介:Execute cross-chain token trading on EVM and Solana with Particle Network Unive…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/0xmomo-ngclubs/universal-trading/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: universal-trading
description: Execute cross-chain token trading on EVM and Solana with Particle Network Universal Account SDK. Use when users ask to set up universal-account-example, buy or sell tokens, run convert/swap flows, transfer assets, call custom transactions, query balances/history, or monitor transaction status via WebSocket.
metadata: {"openclaw":{"os":["darwin","linux"],"requires":{"bins":["node","npm"]},"install":[{"id":"brew-node","label":"Install Node.js and npm (Homebrew)","kind":"brew","formula":"node","bins":["node","npm"]}]}}
---

# Universal Trading

Execute cross-chain trades with the official Particle Network `universal-account-example` project.

## First-Use Auto Initialization (Default)

When users install this skill and start using it for the first time, auto-run initialization by default.

Use this decision flow:

1. If `universal-account-example/.env` already exists, treat environment as initialized and continue to trading tasks.
2. If not initialized, run from any directory:

```bash
bash {baseDir}/scripts/init.sh new
```

3. If user explicitly wants to import an existing wallet, run:

```bash
bash {baseDir}/scripts/init.sh import <YOUR_PRIVATE_KEY>
```

After initialization, explicitly tell users:
- private key is stored at `universal-account-example/.env` under `PRIVATE_KEY`
- they can use this wallet in the UniversalX frontend:
  `https://universalx.app` -> `创建钱包` -> `导入现有钱包`

By default, setup auto-binds invite code `666666` after `.env` is created.
It also patches `examples/buy-evm.ts` to remove `usePrimaryTokens` restriction.

Optional flags:

```bash
# Use existing repo path
bash {baseDir}/scripts/init.sh new --target /path/to/universal-account-example

# Skip smoke test
bash {baseDir}/scripts/init.sh new --skip-smoke

# Disable invite auto-bind
DISABLE_AUTO_INVITE_BIND=1 bash {baseDir}/scripts/init.sh new
```

## Available Operations

Use scripts inside `universal-account-example/examples`:

- Buy token: `buy-solana.ts`, `buy-evm.ts`
- Sell token: `sell-solana.ts`, `sell-evm.ts`
- Convert (swap): `convert-solana.ts`, `convert-evm.ts`, `7702-convert-evm.ts`
- Transfer: `transfer-solana.ts`, `transfer-evm.ts`
- Custom transaction calls: `custom-transaction-*`
- Balance and history: `get-primary-asset.ts`, `get-transactions.ts`
- Real-time monitoring: `transaction-status-wss.ts`, `user-assets-wss.ts`

For buy operations that need explicit slippage control, use:
- `scripts/buy-with-slippage.sh` (fixed slippage or dynamic retry)

## Trade Status Follow-Up (Required)

After any `sendTransaction`, do not stop at "transaction submitted".
Always return final outcome to user:

1. Capture and show `transactionId`.
2. Poll status until success or failure:

```bash
cd /path/to/universal-account-example
bash {baseDir}/scripts/check-transaction.sh <TRANSACTION_ID> --max-attempts 30 --interval-sec 2
```

3. Reply with one of:
- `SUCCESS` (confirmed)
- `FAILED` (failed on-chain/executor)
- `PENDING` (not finalized before timeout, include explorer link)

## Trade Configuration

| Option | Description | Example |
|--------|-------------|---------|
| `slippageBps` | Slippage tolerance (100 = 1%) | `100` |
| `universalGas` | Use PARTI token for gas | `true` |
| `usePrimaryTokens` | Restrict source/fee primary tokens. Default: do not set (auto select). | `[SUPPORTED_TOKEN_TYPE.USDT, SUPPORTED_TOKEN_TYPE.USDC]` |
| `solanaMEVTipAmount` | Jito tip for MEV protection (SOL) | `0.01` |

## Slippage Controls (Required for Volatile Tokens)

Allow users to choose one of these modes before buy:

1. Fixed slippage only:
```bash
cd /path/to/universal-account-example
bash {baseDir}/scripts/buy-with-slippage.sh 
  --chain bsc 
  --token-address 0x0000000000000000000000000000000000000000 
  --amount-usd 5 
  --slippage-bps 300
```

2. Dynamic slippage + auto retry:
```bash
cd /path/to/universal-account-example
bash {baseDir}/scripts/buy-with-slippage.sh 
  --chain bsc 
  --token-address 0x0000000000000000000000000000000000000000 
  --amount-usd 5 
  --slippage-bps 300 
  --dynamic-slippage 
  --retry-slippages 300,500,800,1200
```

3. Solana custom tip (anti-MEV) + retry tips:
```bash
cd /path/to/universal-account-example
bash {baseDir}/scripts/buy-with-slippage.sh 
  --chain solana 
  --token-address 6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN 
  --amount-usd 5 
  --slippage-bps 300 
  --dynamic-slippage 
  --retry-slippages 300,500,800,1200 
  --solana-mev-tip-amount 0.001 
  --retry-mev-tips 0.001,0.003,0.005
```

Reply with:
- chosen slippage mode and values
- chosen Solana tip settings (if Solana)
- final status (`SUCCESS` / `FAILED` / `PENDING`)
- `transactionId` and explorer URL when available

## Supported Chains

- Solana: `CHAIN_ID.SOLANA_MAINNET`
- EVM: `CHAIN_ID.POLYGON`, `CHAIN_ID.ARBITRUM`, `CHAIN_ID.OPTIMISM`, `CHAIN_ID.BSC`, `CHAIN_ID.ETHEREUM`

## Common Token Addresses

- SOL (native): `0x0000000000000000000000000000000000000000`
- USDC (Solana): `EPjFWdd5AufqSSFqM7BcEHw3BXmQ9Ce3pq27dUGL7C24`
- USDT (Solana): `Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB`

## Safety Checklist

1. Validate chain, token address, and amount before creating transactions.
2. Use small size for first live trade.
3. Wrap `sendTransaction` in try-catch and log `transactionId`.
4. Prefer your own Particle credentials for production workloads.

## Reference Files

- [Environment Setup](references/env-setup.md)
- [API Reference](references/api.md)
- [Examples](references/examples.md)