Xpersona
X

xaut-trade

CLAWHUB · Unverified

Buy or sell XAUT (Tether Gold) on Ethereum. Supports market orders (Uniswap V3) and limit orders (UniswapX). Wallet modes: Foundry keystore or WDK. Delegates...

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s171zxp6gfdn6n628g3vz83vc183nhyk:aurehub-xaut-trade
  1. Install using `clawhub skill install s171zxp6gfdn6n628g3vz83vc183nhyk:aurehub-xaut-trade` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/aure-duncan/aurehub-xaut-trade before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-aure-duncan-aurehub-xaut-trade/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

154,108 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: xaut-trade
description: "Buy or sell XAUT (Tether Gold) on Ethereum. Supports market orders (Uniswap V3) and limit orders (UniswapX). Wallet modes: Foundry keystore or WDK. Delegates non-XAUT intents to registered skills (e.g. Polymarket prediction markets, Hyperliquid trading). Triggers: buy XAUT, XAUT trade, swap USDT for XAUT, sell XAUT, swap XAUT for USDT, limit order, limit buy XAUT, limit sell XAUT, check limit order, cancel limit order, XAUT when, create wallet, setup wallet, polymarket, prediction market, bet on, odds on, hyperliquid, perp, perpetual, long, short, open long, open short, close position, leverage."
license: MIT
compatibility: "Requires Node.js >= 18, Ethereum RPC (HTTPS), and UniswapX API access. Foundry (cast) required only for foundry wallet mode."
metadata:
  author: aurehub
  version: "2.3.0"
---

# xaut-trade

Execute `USDT -> XAUT` buy and `XAUT -> USDT` sell flows via Uniswap V3.

## When to Use

Use when the user wants to buy or sell XAUT (Tether Gold):
- **Buy**: USDT -> XAUT
- **Sell**: XAUT -> USDT

## External Communications

This skill connects to external services (Ethereum RPC, UniswapX API, and optionally xaue.com rankings). On first setup, it may install dependencies via npm. Inform the user before executing any external communication for the first time. See the README for a full list.

## Environment & Security Declaration

### Required config files (under `~/.aurehub/`)

| File | Purpose | Required |
|------|---------|----------|
| `.env` | Environment variables (WALLET_MODE, ETH_RPC_URL, password file paths) | Yes |
| `config.yaml` | Network and limit-order configuration (chain ID, contract addresses, UniswapX API URL) | Yes |
| `.wdk_vault` | Encrypted wallet vault (XSalsa20-Poly1305) | When WALLET_MODE=wdk |
| `.wdk_password` | Vault decryption password (file mode 0600) | When WALLET_MODE=wdk |

### Environment variables

| Variable | Purpose | Required |
|----------|---------|----------|
| `WALLET_MODE` | Wallet type: `wdk` (encrypted vault) or `foundry` (keystore) | Yes |
| `ETH_RPC_URL` | Ethereum JSON-RPC endpoint (HTTPS) | Yes |
| `WDK_PASSWORD_FILE` | Path to WDK vault password file (mode 0600) | When WALLET_MODE=wdk |
| `WDK_ACCOUNT_INDEX` | HD derivation index (0-based) for WDK wallet address | No (default: 0) |
| `KEYSTORE_PASSWORD_FILE` | Path to Foundry keystore password file (mode 0600) | When WALLET_MODE=foundry |
| `UNISWAPX_API_KEY` | UniswapX API key for limit orders | When using limit orders |
| `ETH_RPC_URL_FALLBACK` | Optional fallback RPC endpoint | No |

### Network access

- **Ethereum JSON-RPC** (ETH_RPC_URL) — blockchain reads and transaction submission
- **UniswapX API** (HTTPS) — limit order nonce, submission, status, cancellation
- **xaue.com Rankings API** (HTTPS, **opt-in only**) — leaderboard registration; only contacted after user explicitly enables `RANKINGS_OPT_IN=true` in `~/.aurehub/.env`

### Data shared with third parties

| Service | Data sent | Condition

README.md

# xaut-trade

Our skills are developed by Duncan.Aure (Duncan), an AI Agent created by Aurelion, the world's first NASDAQ-listed Tether Gold (XAU₮) treasury company. Duncan executes on-chain financial actions through modular AI Agent Skills. Enables automated XAU₮ trading, cross-protocol DeFi execution, and programmable digital gold allocation.

Buy and sell XAUT (Tether Gold) on Ethereum mainnet via AI Agent, using Uniswap V3 + Node.js (ethers.js) under the hood.

## Quick Start

**Prerequisites:** Node.js ≥ 18 · ETH ≥ 0.005 (gas) · USDT or XAUT to trade

**1. Install**

```bash
npx skills add aurehub/skills
```

**2. Start trading** — if setup is needed, the Agent will guide you through it automatically:

```
buy XAUT with 100 USDT
```

---

## Supported Pairs

| Direction | Pair | Description |
|-----------|------|-------------|
| Buy | USDT → XAUT | Swap USDT for gold token |
| Sell | XAUT → USDT | Swap gold token back to USDT |

## Usage

xaut-trade handles XAUT/USDT trades natively and delegates other intents to specialized skills:

| Intent | Handled by | Example |
|--------|-----------|---------|
| Buy / sell XAUT | xaut-trade (built-in) | `buy XAUT with 100 USDT` |
| Limit order XAUT | xaut-trade (built-in) | `buy 0.01 XAUT when price drops to 3000` |
| Prediction markets | polymarket-trade | `bet on Bitcoin above 100k` |
| Perp / spot futures | hyperliquid-trade | `open long ETH on Hyperliquid` |

Just talk to the Agent in natural language:

### Buy

```
buy XAUT with 100 USDT
buy 200 USDT worth of XAUT
```

### Sell

```
sell 0.01 XAUT
swap 0.05 XAUT for USDT
sell 0.1 XAUT
```

### Limit Buy

```
buy 0.01 XAUT when price drops to 3000 USDT
limit order: buy 0.01 XAUT when price reaches 3000 USDT
limit buy XAUT at 3000, amount 0.01, valid 3 days
```

### Limit Sell

```
sell 0.01 XAUT when price rises to 4000 USDT
limit sell 0.01 XAUT at target price 3800 USDT, valid 3 days
sell 0.01 XAUT when price reaches 4000
```

### Check Limit Order

```
check my limit order status, orderHash is 0x...
```

### Cancel Limit Order

```
cancel limit order, orderHash is 0x...
```

### Check Balance

```
check my XAUT balance
```

## Trade Flow

For both buy and sell, the Agent follows this semi-automated flow:

```
Pre-flight checks → On-chain quote → Preview display → [Threshold-based confirmation] → Approve (mode-based confirmation) → Swap → Result verification
```

Before on-chain writes, the Agent always displays full commands. Confirmation level is policy-driven:
- Trade confirmation uses USD thresholds (`confirm_trade_usd`, `large_trade_usd`):
  - `< confirm_trade_usd`: preview shown, no blocking confirmation required
  - `>= confirm_trade_usd` and `< large_trade_usd`: single confirmation required
  - `>= large_trade_usd` or estimated slippage exceeds `max_slippage_bps_warn`: double confirmation required
- Approval confirmation uses `approve_confirmation_mode` with oversize safety override

## Risk Controls

| Rule | Default Threshold | Behavior 

_meta.json

{
  "ownerId": "kn7ec0bbtyhs5pvra3g6vqqhd182dsk2",
  "slug": "aurehub-xaut-trade",
  "version": "2.3.0",
  "publishedAt": 1776217229628
}

references/balance.md

# Balance & Pre-flight Checks

Complete the following steps in order before any quote or execution.

All commands below assume CWD is `$SCRIPTS_DIR` and env is sourced. Each Bash block must begin with:

```bash
source ~/.aurehub/.env
cd "$SCRIPTS_DIR"
```

## 1. Environment Check

```bash
source ~/.aurehub/.env
cd "$SCRIPTS_DIR"
node swap.js address
```

If the command fails, stop and prompt:
- Node.js not installed or < 18: install Node.js first
- Config missing: trigger onboarding
- RPC unavailable: trigger RPC fallback sequence (see RPC Fallback section in SKILL.md)

## 2. Wallet Mode Validation

Check `WALLET_MODE` in `~/.aurehub/.env`:

- **If `WALLET_MODE=wdk`**: verify `WDK_PASSWORD_FILE` is set and readable:
  ```bash
  source ~/.aurehub/.env
  test -r "$WDK_PASSWORD_FILE" && echo "OK" || echo "FAIL"
  ```
  If `FAIL`, hard-stop:
  > Password file not readable: `$WDK_PASSWORD_FILE`
  > Create it with: `bash -c 'read -rsp "WDK password: " p </dev/tty; echo; printf "%s" "$p" > ~/.aurehub/.wdk_password; chmod 600 ~/.aurehub/.wdk_password; echo "Saved."'`

- **If `WALLET_MODE=foundry`**: verify `FOUNDRY_ACCOUNT` and `KEYSTORE_PASSWORD_FILE` are set:
  ```bash
  source ~/.aurehub/.env
  [ -n "$FOUNDRY_ACCOUNT" ] && [ -n "$KEYSTORE_PASSWORD_FILE" ] && echo "OK" || echo "FAIL"
  ```
  If `FAIL`, hard-stop:
  > Missing keystore signing config. Set both `FOUNDRY_ACCOUNT` and `KEYSTORE_PASSWORD_FILE` in `.env`.

  Verify password file is readable:
  ```bash
  source ~/.aurehub/.env
  test -r "$KEYSTORE_PASSWORD_FILE" && echo "OK" || echo "FAIL"
  ```
  If `FAIL`, hard-stop:
  > Password file not readable: `$KEYSTORE_PASSWORD_FILE`

If `PRIVATE_KEY` exists in `.env`, hard-stop immediately:
> `PRIVATE_KEY` runtime mode is no longer supported.
> Remove `PRIVATE_KEY` from `.env` and use either WDK or Foundry wallet mode.

## 3. Derive Wallet Address

```bash
source ~/.aurehub/.env
cd "$SCRIPTS_DIR"
WALLET_ADDRESS=$(node swap.js address | node -p "JSON.parse(require('fs').readFileSync(0,'utf8')).address")
echo "$WALLET_ADDRESS"
```

## 4. Full Balance Check (ETH + USDT + XAUT)

```bash
source ~/.aurehub/.env
cd "$SCRIPTS_DIR"
node swap.js balance
```

Output is JSON with all balances pre-formatted (human-readable):

```json
{
  "address": "0x...",
  "ETH": "0.05",
  "USDT": "1000.0",
  "XAUT": "0.5"
}
```

- If ETH balance is below `risk.min_eth_for_gas`, hard-stop
- **Buy flow**: if USDT balance is insufficient for the intended trade, hard-stop and report the shortfall
- **Sell flow**: if XAUT balance is insufficient for the intended trade, hard-stop and report the shortfall

references/buy.md

# Buy Execution (USDT -> XAUT)

All commands below assume CWD is `$SCRIPTS_DIR` and env is sourced. Each Bash block must begin with `source ~/.aurehub/.env` and `cd "$SCRIPTS_DIR"`.

## 0. Pre-execution Declaration

- Current stage must be `Ready to Execute`
- Quote and explicit user confirmation must already be complete
- Full command must be displayed before execution

## 1. Allowance Check

```bash
source ~/.aurehub/.env
cd "$SCRIPTS_DIR"
node swap.js allowance --token USDT
```

Output:

```json
{
  "address": "0x...",
  "token": "USDT",
  "allowance": "0.0",
  "spender": "0x..."
}
```

If allowance < intended `AMOUNT_IN`, approve first.

## 2. Approve (USDT)

USDT requires a reset-to-zero before approving (handled internally by swap.js when `token_rules.USDT.requires_reset_approve: true` in config):

```bash
source ~/.aurehub/.env
cd "$SCRIPTS_DIR"
APPROVE_RESULT=$(node swap.js approve --token USDT --amount <AMOUNT_IN>)
echo "$APPROVE_RESULT"
```

Output:

```json
{
  "address": "0x...",
  "token": "USDT",
  "amount": "<AMOUNT_IN>",
  "spender": "0x...",
  "txHash": "0x..."
}
```

The reset-to-zero step is handled automatically — no separate call needed.

Report: `Approve tx: https://etherscan.io/tx/<txHash>`

## 3. Swap Execution

```bash
source ~/.aurehub/.env
cd "$SCRIPTS_DIR"
SWAP_RESULT=$(node swap.js swap --side buy --amount <AMOUNT_IN> --min-out <MIN_AMOUNT_OUT>)
echo "$SWAP_RESULT"
```

Output:

```json
{
  "address": "0x...",
  "side": "buy",
  "amountIn": "<AMOUNT_IN>",
  "minAmountOut": "<MIN_AMOUNT_OUT>",
  "txHash": "0x...",
  "status": "success",
  "gasUsed": "180000"
}
```

Report: `Swap tx: https://etherscan.io/tx/<txHash>`

> On failure (`"status": "failed"`), report retry suggestions (reduce trade amount / increase slippage tolerance / check nonce and gas).

## 3a. Swap Error Recovery

**CRITICAL**: If the swap command returns an error, exits with a non-zero code, or returns `"status": "unconfirmed"`:

1. **Do NOT retry immediately.** The transaction may have been broadcast and mined despite the RPC error.
2. Check the current balance:
   ```bash
   source ~/.aurehub/.env
   cd "$SCRIPTS_DIR"
   node swap.js balance
   ```
3. Compare the USDT balance against the pre-swap balance (from pre-flight Step 1):
   - **If USDT balance decreased by the trade amount** → the swap **succeeded**. Proceed to Result Verification (Step 4). Do NOT re-approve or re-swap.
   - **If USDT balance is unchanged** → the swap did **not** execute. Safe to retry from Step 1 (Allowance Check).
4. If a `txHash` was returned (including in the `"unconfirmed"` response), verify on Etherscan: `https://etherscan.io/tx/<txHash>`

> **Why this matters**: RPC nodes can return errors (e.g. 400, 504, "Unknown block") even when the transaction was successfully broadcast and mined. Retrying without checking balance will execute a **duplicate trade**, costing the user double.

## 4. Result Verification

```bash
source ~/.aurehub/.env
cd "$SCRIPTS_DIR"
node swap.js b

Sponsored

Ads related to xaut-trade and adjacent AI workflows.