LeoYeAI/agent-master-skills / skills/aurehub-xaut-trade
xaut-trade
FlaggedBuy 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.
references/balance.md
View on GitHub# 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
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |