ATXSwap Skill
Execute ATX trading and wallet workflows on BSC. This skill is designed for
agents that need safe, repeatable commands for wallet management, ATX/USDT
quotes, swaps, V3 liquidity actions, and transfers.
- SDK:
atxswap-sdk on npm (source)
- Keystore dir:
~/.config/atxswap/keystore (fixed, not configurable)
- Secrets dir:
~/.config/atxswap/ (master.key + secrets.json)
Use This Skill For
- Create the single wallet used by this skill instance (importing an existing private key is not supported)
- Query ATX price, balances, LP positions, quotes, and arbitrary ERC20 token info
- Buy or sell ATX against USDT on PancakeSwap V3
- Add liquidity, remove liquidity, collect fees, or burn empty LP NFTs
- Transfer BNB, ATX, USDT, or arbitrary ERC20 tokens
Before First Use
This skill ships its own Node scripts and depends on atxswap-sdk.
- Open the skill directory where this
SKILL.md is installed.
- Run
npm install there before using any script.
- If
npm install fails, stop and report the dependency error instead of guessing.
If the skill is installed via ClawHub or OpenClaw CLI, the install location is
typically ~/.clawhub/skills/atxswap/ (or the equivalent client-managed path).
If you cloned this repository directly, the location is skills/atxswap/.
Script Location
Use the skill directory path to locate scripts. If ${SKILL_DIR} is available
(injected by skills.sh-compatible runtimes), use it; otherwise use the absolute
path to this skill's installed directory.
Example:
cd skills/atxswap && npm install
cd "${SKILL_DIR}" && node scripts/wallet.js list
All examples below use cd "${SKILL_DIR}" && for clarity. If your runtime does
not inject ${SKILL_DIR}, replace it with the absolute path of the installed
skill directory.
Runtime Notes
BSC_RPC_URL is optional and supports comma-separated values for fallback,
e.g. BSC_RPC_URL="https://primary,https://backup1,https://backup2". When
unset, scripts use a built-in fallback list of 8 BSC public RPC endpoints
and viem will retry them in order.
- Wallet files live under
~/.config/atxswap/keystore.
- Secure secrets live under
~/.config/atxswap/ (master.key + secrets.json).
- Only one wallet is allowed per skill installation. If a wallet already
exists,
wallet.js create fails.
- Use
wallet.js list before creating a wallet.
- Importing an existing private key via this skill is not supported. If the
user asks to import a private key, refuse and tell them to use a dedicated
wallet tool of their choice.
- Scripts write JSON output.
wallet.js export prints the address's
encrypted keystore V3 JSON to stdout (or writes it to a file via
--out <file>); it never prints the raw private key.
query.js quote can return a JSON error if the configured Quoter or RPC
rejects the simulation. Surface the error and do not proceed to a write.
Password Rules
When the user asks to create a wallet:
- Ask the user for a password first (do NOT generate one).
- Pass it via
--password <pwd> to the script when running non-interactively.
- The password is auto-saved to secure storage after creation.
- Never print the password back to the chat.
For swap, transfer, and liquidity operations, rely on auto-unlock
first. Only ask for the password if auto-unlock fails.
Hard Safety Rules
- Treat all BSC writes as real-asset operations.
- NEVER output private keys or passwords in chat.
- ALWAYS run a preview before write actions: query price, quote, balance,
or positions as appropriate.
- ALWAYS show the preview to the user and wait for explicit confirmation
before swap, transfer, or liquidity writes.
- NEVER execute large trades without the user saying "yes" or "confirm".
wallet.js export only emits the encrypted keystore JSON, never the raw
private key. There is no command that prints the unencrypted private key,
and the agent must not attempt to derive or display one.
- Prefer
wallet.js export <address> --out <file> and tell the user the file
path. Avoid pasting the keystore JSON itself into chat unless the user
explicitly asks for it.
Required Preview Flow
Before every write action:
- Query the price, quote, balance, or positions that match the requested action.
- Summarize the preview in plain language.
- Ask the user to confirm.
- Execute the write command only after confirmation.
- Return the transaction hash and the key result fields.
High-Value Workflows
Check market state
cd "${SKILL_DIR}" && node scripts/query.js price
cd "${SKILL_DIR}" && node scripts/query.js balance <address>
cd "${SKILL_DIR}" && node scripts/query.js positions <address>
Preview before swap
cd "${SKILL_DIR}" && node scripts/query.js quote <buy|sell> <amount>
Execute after confirmation
cd "${SKILL_DIR}" && node scripts/swap.js buy <usdtAmount> [--from address] [--slippage bps] [--password <pwd>]
cd "${SKILL_DIR}" && node scripts/liquidity.js add <atxAmount> <usdtAmount> [--from address] [--password <pwd>]
cd "${SKILL_DIR}" && node scripts/transfer.js atx <to> <amount> [--from address] [--password <pwd>]
Command Reference
wallet.js
cd "${SKILL_DIR}" && node scripts/wallet.js create [name] --password <pwd>
cd "${SKILL_DIR}" && node scripts/wallet.js list
cd "${SKILL_DIR}" && node scripts/wallet.js export <address> [--out <file>]
cd "${SKILL_DIR}" && node scripts/wallet.js has-password <address>
cd "${SKILL_DIR}" && node scripts/wallet.js forget-password <address>
query.js
cd "${SKILL_DIR}" && node scripts/query.js price
cd "${SKILL_DIR}" && node scripts/query.js balance <address>
cd "${SKILL_DIR}" && node scripts/query.js quote <buy|sell> <amount>
cd "${SKILL_DIR}" && node scripts/query.js positions <address>
cd "${SKILL_DIR}" && node scripts/query.js token-info <tokenAddress>
swap.js
cd "${SKILL_DIR}" && node scripts/swap.js buy <usdtAmount> [--from address] [--slippage bps] [--password <pwd>]
cd "${SKILL_DIR}" && node scripts/swap.js sell <atxAmount> [--from address] [--slippage bps] [--password <pwd>]
liquidity.js
cd "${SKILL_DIR}" && node scripts/liquidity.js add <atxAmount> <usdtAmount> [--from address] [--password <pwd>]
cd "${SKILL_DIR}" && node scripts/liquidity.js remove <tokenId> <percent> [--from address] [--password <pwd>]
cd "${SKILL_DIR}" && node scripts/liquidity.js collect <tokenId> [--from address] [--password <pwd>]
cd "${SKILL_DIR}" && node scripts/liquidity.js burn <tokenId> [--from address] [--password <pwd>]
transfer.js
cd "${SKILL_DIR}" && node scripts/transfer.js bnb <to> <amount> [--from address] [--password <pwd>]
cd "${SKILL_DIR}" && node scripts/transfer.js atx <to> <amount> [--from address] [--password <pwd>]
cd "${SKILL_DIR}" && node scripts/transfer.js usdt <to> <amount> [--from address] [--password <pwd>]
cd "${SKILL_DIR}" && node scripts/transfer.js token <tokenAddress> <to> <amount> [--from address] [--password <pwd>]
When To Refuse Or Pause
- Missing wallet but the user requests a write action
- Missing confirmation for swap, transfer, or liquidity writes
npm install has not been run successfully in the skill directory
- RPC, dependency, or wallet-unlock errors that make the state unclear
Standard Workflow
For any write action:
- Query current price, quote, balance, or positions as needed.
- Summarize the preview for the user.
- Wait for explicit confirmation.
- Execute the write command.
- Report the transaction hash and result.