Skills tempo-stable-uniswap-swaps
Tempo stablecoin and token swap operations for agents. Use when working with pathUSD/USDC.e balances, swapping between USDC.e and pathUSD, or executing any-token swaps via Uniswap on Tempo with quote, Permit2 approvals, simulation, and broadcast.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/aviclaw/tempo-stable-uniswap-swaps" ~/.claude/skills/openclaw-skills-tempo-stable-uniswap-swaps && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/aviclaw/tempo-stable-uniswap-swaps" ~/.openclaw/skills/openclaw-skills-tempo-stable-uniswap-swaps && rm -rf "$T"
manifest:
skills/aviclaw/tempo-stable-uniswap-swaps/SKILL.mdsource content
Tempo Stable + Uniswap Swaps
Use this skill for low-friction Tempo execution with Foundry (
cast) and Uniswap Trade API.
One-File Mode (Clawhub-Friendly)
Use this
SKILL.md alone. No other files are required.
If scripts are unavailable, run the command playbooks in this file directly.
Network + Tokens
- Chain: Tempo mainnet (
)chainId=4217 - RPC:
https://rpc.presto.tempo.xyz
:pathUSD0x20C0000000000000000000000000000000000000
:USDC.e0x20c000000000000000000000b9537d11c60e8b50
:TDOGE0x20C000000000000000000000d5d5815Ae71124d1- Permit2:
0x000000000022D473030F116dDEE9F6B43aC78BA3
Foundry Prereq Check (Required)
Check:
command -v cast && cast --version
Install if missing:
curl -L https://foundry.paradigm.xyz | bash foundryup
pathUSD vs USDC.e
is Tempo-native infrastructure stablecoin used in routing/fees.pathUSD
is bridged stablecoin liquidity.USDC.e- Do not attempt exact full-balance
transfers; leave fee headroom.pathUSD
Required Tools + Env
- Tools:
,cast
,curljq - Env:
PRIVATE_KEYUNISWAP_API_KEY- Optional:
(default above)RPC_URL
Quick Balance Checks
WALLET=$(cast wallet address --private-key "$PRIVATE_KEY") cast call 0x20C0000000000000000000000000000000000000 \ "balanceOf(address)(uint256)" "$WALLET" --rpc-url "${RPC_URL:-https://rpc.presto.tempo.xyz}" cast call 0x20c000000000000000000000b9537d11c60e8b50 \ "balanceOf(address)(uint256)" "$WALLET" --rpc-url "${RPC_URL:-https://rpc.presto.tempo.xyz}"
Transfer pathUSD
cast send 0x20C0000000000000000000000000000000000000 \ "transfer(address,uint256)" <TO> <AMOUNT_RAW> \ --private-key "$PRIVATE_KEY" --rpc-url "${RPC_URL:-https://rpc.presto.tempo.xyz}" --gas-limit 100000
Swap Any Token on Tempo via Uniswap (Exact Input)
- Quote:
curl -sS https://trade-api.gateway.uniswap.org/v1/quote \ -H 'content-type: application/json' \ -H "x-api-key: $UNISWAP_API_KEY" \ --data '{ "type":"EXACT_INPUT", "amount":"<AMOUNT_IN_RAW>", "tokenInChainId":4217, "tokenOutChainId":4217, "tokenIn":"<TOKEN_IN>", "tokenOut":"<TOKEN_OUT>", "swapper":"<WALLET>", "slippageTolerance":2.5 }'
- Ensure approvals:
:TOKEN_IN -> Permit2
cast send <TOKEN_IN> "approve(address,uint256)" \ 0x000000000022D473030F116dDEE9F6B43aC78BA3 \ 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff \ --private-key "$PRIVATE_KEY" --rpc-url "${RPC_URL:-https://rpc.presto.tempo.xyz}" --gas-limit 900000
Permit2 -> spender (spender from quote permitData.values.spender):
EXP=$(( $(date +%s) + 31536000 )) cast send 0x000000000022D473030F116dDEE9F6B43aC78BA3 \ "approve(address,address,uint160,uint48)" \ <TOKEN_IN> <SPENDER> 1461501637330902918203684832716283019655932542975 "$EXP" \ --private-key "$PRIVATE_KEY" --rpc-url "${RPC_URL:-https://rpc.presto.tempo.xyz}" --gas-limit 900000
- Build swap tx from quote object (
withPOST /v1/swap
), then simulate:{ "quote": <quote_object> }
curl -s "${RPC_URL:-https://rpc.presto.tempo.xyz}" -H 'content-type: application/json' --data \ '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"from":"<WALLET>","to":"<SWAP_TO>","data":"<SWAP_DATA>"},"latest"]}'
- Broadcast:
cast send <SWAP_TO> "<SWAP_DATA>" \ --private-key "$PRIVATE_KEY" \ --rpc-url "${RPC_URL:-https://rpc.presto.tempo.xyz}" \ --gas-limit <GAS_LIMIT> --gas-price <MAX_FEE_PER_GAS>
Known Errors
: set Permit2 allowance for token+spender.AllowanceExpired(...)
: approve token to Permit2.InsufficientAllowance- Quote exists but swap reverts: refresh quote and retry.
- Full
transfer fails: leave fee headroom.pathUSD
Optional Script
If available, use:
scripts/uniswap_exact_input_swap.sh --token-in <TOKEN_IN> --token-out <TOKEN_OUT> --amount-in <RAW_AMOUNT>