cap-balances-in-a-hot-wallet
Use when an operational key signs autonomously and sits online. Sets a float ceiling, keeps the rest cold, and funds the hot wallet on a schedule instead of letting it accumulate.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- cap-balances-in-a-hot-wallet
- description
- Use when an operational key signs autonomously and sits online. Sets a float ceiling, keeps the rest cold, and funds the hot wallet on a schedule instead of letting it accumulate.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md354 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
Cap the balance a hot wallet may hold
An online signing key must be assumed leakable, so the point of a hot wallet is to hold only what the next few hours of operations need. This skill fixes a hard ceiling per hot wallet and sweeps surplus to cold storage on a schedule.
Procedure
- Measure real outflow. Pull the last 30 days of outbound value from the hot address and take the 99th-percentile daily figure:
cast logs --address $TOKEN --from-block $START --to-block $LATEST --json | jq -r '.[].data'or query an indexer for daily outbound totals. - Set the ceiling to that 99th-percentile amount rounded up — commonly 2–5% of the treasury per hot wallet. The ceiling is never "everything".
- Sweep surplus to cold whenever the balance exceeds the ceiling, with an idempotent sweeper on a cron:
cast send $TOKEN "transfer(address,uint256)" $COLD $SURPLUS --account sweeper --rpc-url $RPC - Fund the hot wallet on a schedule from cold rather than letting deposits rest there. Inbound customer funds route to a cold receiving address, not the operational key.
- Alert when the balance is within 20% of the ceiling so a human reviews before the sweeper fires.
- Re-derive the ceiling quarterly and after any volume change; a stale ceiling either starves operations or over-exposes funds.
Pitfalls
- A sweeper holding an unlimited allowance from the cold wallet makes the sweeper key the new best target; cap its allowance to a single sweep amount.
- On high-fee chains the sweeper needs native balance for gas; a drained gas balance strands the tokens it was sent to move.
- Round-number ceilings ("keep 10 ETH") rot fast; derive from measured volume.
- If surplus moves only when a human clicks, the ceiling is aspirational, not enforced.
- A hot wallet that also holds the deployer key conflates roles; the sweeper should not be able to upgrade contracts.
- A hot wallet refilled by an automated payout job keeps restoring itself after a sweep; cap the job's per-run amount or the ceiling is fiction.
- A multisig hot wallet is still hot: the convenience of an API signer does not change the online-exposure assumption.
- Track the ceiling in the same units you measure volume; mixing a token float with a native gas float hides the real exposure.
- If the sweeper and the signer share one key, an attacker who takes that key both sweeps and drains with it.
Verification
cast balance $HOT --rpc-url $RPC && echo "ceiling=$CEILING"
# expect balance <= ceiling; a value above it means a sweep is overdue
Report the measured ceiling, the current balance, and the sweeper's last run, with the commands behind them.
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.