defi-transaction-builder
npx machina-cli add skill auralshin/agent-skills/defi-transaction-builder --openclawFiles (1)
SKILL.md
1.9 KB
DeFi Transaction Builder
Purpose
Prepare transaction plans and calldata for user review. This skill is strictly for unsigned payload generation and validation.
Use this skill when
- The user wants transaction parameters for swaps, supply/borrow, staking, claiming, or bridging.
- The user requests calldata formatting or simulation-ready bundles.
Never do
- Never ask for private keys, seed phrases, or wallet exports.
- Never sign or broadcast transactions.
- Never omit warnings for network, slippage, or allowance risk.
Workflow
- Confirm intent and constraints:
- Chain/network
- Token amounts and units
- Slippage and deadline
- Build the unsigned transaction payload(s).
- Validate shape and safety checks using
scripts/validate_tx_bundle.py. - Output a simulation-first transaction plan with human-readable checks.
Required output format
{
"intent": "string",
"network": {
"chain_id": 0,
"name": "string"
},
"transactions": [
{
"description": "string",
"to": "0x...",
"function_signature": "string",
"calldata": "0x...",
"value_wei": "0",
"recommended_gas_limit": 0,
"preconditions": ["string"],
"postconditions": ["string"]
}
],
"simulation_recommendation": "string",
"critical_warnings": ["string"]
}
Bundled resources
references/pre-sign-checklist.md: Mandatory pre-sign review checks.references/common-patterns.md: Common DeFi call patterns and pitfalls.scripts/validate_tx_bundle.py: Local validator for transaction-plan JSON.assets/tx-plan-template.json: Starter template for consistent output.
Source
git clone https://github.com/auralshin/agent-skills/blob/main/skills/defi-transaction-builder/SKILL.mdView on GitHub Overview
Generates unsigned DeFi transaction payloads (to/data/value/chain) for swaps, lending, staking, and bridging. It provides planning and calldata formatting for review before signing, with built-in validation and a simulation-ready output.
How This Skill Works
The workflow is: 1) Confirm intent and constraints (chain, amounts, slippage, deadline). 2) Build the unsigned payloads and calldata. 3) Validate their shape and safety using scripts/validate_tx_bundle.py and output a simulation-first plan for user review.
When to Use It
- When you need parameters for swaps, supply/borrow, staking, claiming rewards, or bridging.
- When calldata formatting or simulation-ready bundles are requested.
- When planning multi-action DeFi flows and want a bundled, reviewable plan.
- When you want unsigned payloads that you or a DEX can later sign, without exposing keys.
- When you need warnings on network, slippage, or allowance risks included in the plan.
Quick Start
- Step 1: Confirm intent, network, tokens, amounts, slippage, and deadline.
- Step 2: Build the unsigned payloads for each action (swap, lend/borrow, stake, bridge).
- Step 3: Run the validator and review the simulation plan.
Best Practices
- Always confirm chain_id and network before building.
- Specify token amounts, units, slippage, and deadline clearly.
- Define preconditions and postconditions for each transaction.
- Run the local validator: scripts/validate_tx_bundle.py before any signing.
- Document gas limits and assess risk of retries and allowances.
Example Use Cases
- Prepare an unsigned swap payload on Ethereum mainnet to convert USDC to ETH.
- Draft a lend/borrow bundle for a DeFi protocol like Aave.
- Create a staking payload to claim rewards and restake.
- Assemble a cross-chain bridge payload to move tokens to another chain.
- Generate a simulation-ready multi-call bundle for a DeFi strategy across assets.
Frequently Asked Questions
Add this skill to your agents