{"id":50508278,"url":"https://github.com/NethermindEth/defi-skills","last_synced_at":"2026-06-19T12:00:40.341Z","repository":{"id":347385886,"uuid":"1191939235","full_name":"NethermindEth/defi-skills","owner":"NethermindEth","description":"Natural language to unsigned DeFi transactions.","archived":false,"fork":false,"pushed_at":"2026-05-06T07:33:29.000Z","size":390,"stargazers_count":14,"open_issues_count":7,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-06T09:36:38.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://defi-skills.nethermind.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NethermindEth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-25T18:25:58.000Z","updated_at":"2026-04-19T07:00:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/NethermindEth/defi-skills","commit_stats":null,"previous_names":["nethermindeth/defi-skills"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NethermindEth/defi-skills","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NethermindEth%2Fdefi-skills","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NethermindEth%2Fdefi-skills/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NethermindEth%2Fdefi-skills/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NethermindEth%2Fdefi-skills/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NethermindEth","download_url":"https://codeload.github.com/NethermindEth/defi-skills/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NethermindEth%2Fdefi-skills/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34530302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-02T18:00:26.754Z","updated_at":"2026-06-19T12:00:40.315Z","avatar_url":"https://github.com/NethermindEth.png","language":"Python","funding_links":[],"categories":["Trading \u0026 DeFi"],"sub_categories":[],"readme":"# defi-skills\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org) ![Chains: 6](https://img.shields.io/badge/chains-6-orange.svg) ![Protocols: 14](https://img.shields.io/badge/protocols-14-brightgreen.svg) ![Actions: 54](https://img.shields.io/badge/actions-54-blueviolet.svg)\n\nTranslate natural language into unsigned DeFi transaction payloads. A data-driven playbook engine resolves human-readable parameters (token symbols, ENS names, decimal amounts) into ABI-encoded calldata, with zero protocol-specific code in the engine.\n\n### Give your agent DeFi superpowers\n\n**Claude Code:**\n```\n/plugin marketplace add NethermindEth/defi-skills\n/plugin install defi-skills@nethermind-defi-skills\n```\n\n**OpenClaw:**\n```\nnpx clawhub install defi-skills\n```\n\nThat's it. Your agent can now build DeFi transactions:\n\n\u003e *\"Supply 100 USDC to Aave\"* · *\"Swap 0.5 ETH for USDC on Uniswap\"* · *\"Stake 5 ETH on Lido\"*\n\n\n\nhttps://github.com/user-attachments/assets/cdc2fd63-b007-40a4-900e-a6f775b6e9fa\n\n\n\n## Install\n\n```bash\npip install defi-skills\n```\n\nOr from source:\n\n```bash\ngit clone https://github.com/NethermindEth/defi-skills\ncd defi-skills\npython3 -m venv .venv \u0026\u0026 source .venv/bin/activate\npip install -e .\n```\n\n## Quick Start\n\n```bash\ndefi-skills config setup                  # interactive wizard\ndefi-skills actions                       # list all actions\ndefi-skills actions --chain-id 11155111   # list Sepolia actions\n```\n\nBuild unsigned transactions (fully deterministic, no LLM requierd):\n\n```bash\n# Mainnet\ndefi-skills build --action aave_supply --args '{\"asset\":\"USDC\",\"amount\":\"500\"}' --json\n\n# Sepolia\ndefi-skills build --action aave_supply --args '{\"asset\":\"WETH\",\"amount\":\"1\"}' --chain-id 11155111 --json\n\n# More examples\ndefi-skills build --action uniswap_swap --args '{\"asset_in\":\"WETH\",\"asset_out\":\"USDC\",\"amount\":\"0.5\"}' --json\ndefi-skills build --action lido_stake --args '{\"amount\":\"5\"}' --json\ndefi-skills build --action weth_wrap --args '{\"amount\":\"2\"}' --json\n```\n\nInteractive chat mode (requires LLM API key):\n\n```bash\ndefi-skills chat\n```\n\n## Output\n\n```json\n{\n  \"success\": true,\n  \"transactions\": [\n    {\n      \"type\": \"approval\",\n      \"raw_tx\": { \"chain_id\": 1, \"to\": \"0xA0b8...\", \"value\": \"0\", \"data\": \"0x095ea7b3...\" }\n    },\n    {\n      \"type\": \"action\",\n      \"action\": \"aave_supply\",\n      \"function_name\": \"supply\",\n      \"raw_tx\": { \"chain_id\": 1, \"to\": \"0x8787...\", \"value\": \"0\", \"data\": \"0x617ba037...\" }\n    }\n  ]\n}\n```\n\nEach `raw_tx` contains `{chain_id, to, value, data}` -- everything needed to sign and broadcast. The tool never signs or broadcasts. Gas estimation and nonce management are left to the signing wallet.\n\n## Supported Protocols\n\n| Protocol | Chains | Actions |\n|----------|--------|---------|\n| Native ETH | All | `transfer_native` |\n| ERC-20 | All | `transfer_erc20` |\n| ERC-721 | All | `transfer_erc721` |\n| WETH | Mainnet, Arbitrum, Base, Optimism, Sepolia | `weth_wrap`, `weth_unwrap` |\n| Aave V3 | Mainnet, Arbitrum, Base, Optimism, Polygon, Sepolia | `aave_supply`, `aave_withdraw`, `aave_borrow`, `aave_repay`, `aave_set_collateral`, `aave_repay_with_atokens`, `aave_claim_rewards` |\n| Uniswap V3 | Mainnet, Arbitrum, Base, Optimism, Polygon, Sepolia | `uniswap_swap`, `uniswap_lp_mint`, `uniswap_lp_collect`, `uniswap_lp_decrease`, `uniswap_lp_increase` |\n| Compound V3 | Mainnet, Arbitrum, Base, Optimism, Polygon | `compound_supply`, `compound_withdraw`, `compound_borrow`, `compound_repay`, `compound_claim_rewards` |\n| Balancer V2 | Mainnet, Arbitrum, Base, Optimism, Polygon | `balancer_swap`, `balancer_join_pool`, `balancer_exit_pool` |\n| Lido | Mainnet | `lido_stake`, `lido_wrap_steth`, `lido_unwrap_wsteth`, `lido_unstake`, `lido_claim_withdrawals` |\n| Curve | Mainnet | `curve_add_liquidity`, `curve_remove_liquidity`, `curve_gauge_deposit`, `curve_gauge_withdraw`, `curve_mint_crv` |\n| MakerDAO DSR | Mainnet | `maker_deposit`, `maker_redeem` |\n| Rocket Pool | Mainnet | `rocketpool_stake`, `rocketpool_unstake` |\n| EigenLayer | Mainnet | `eigenlayer_deposit`, `eigenlayer_delegate`, `eigenlayer_undelegate`, `eigenlayer_queue_withdrawals`, `eigenlayer_complete_withdrawal` |\n| Pendle V2 | Mainnet | `pendle_swap_token_for_pt`, `pendle_swap_pt_for_token`, `pendle_swap_token_for_yt`, `pendle_swap_yt_for_token`, `pendle_add_liquidity`, `pendle_remove_liquidity`, `pendle_mint_py`, `pendle_redeem_py`, `pendle_claim_rewards` |\n| Fibrous | Base | `fibrous_swap` |\n\n## How It Works\n\n![Architecture Diagram](docs/architecture_overview.png)\n\nThe engine has two modes: `build` (deterministic, no LLM) and `chat` (interactive LLM agent on top). Both use the same pipeline:\n\n1. **Playbooks** -- JSON files define each protocol's actions, parameters, and ABI mappings. Chain-agnostic: no hardcoded addresses.\n2. **ChainResources** -- Per-chain contract addresses in `data/chains/{chain_id}/{protocol}.json`. Supports action overrides (different ABIs) and token overrides (different addresses) per chain.\n3. **Resolvers** -- Pure functions that transform human inputs (token symbols, ENS names, amounts) into on-chain values (addresses, wei, calldata).\n4. **Encoder** -- Maps resolved values to ABI parameters and produces the final `{to, value, data}`.\n\n\u003e For the full component breakdown, see [docs/architecture.md](docs/architecture.md).\n\n## Adding a New Protocol\n\nUse the Claude Code agent for the fastest path:\n\n```\n@playbook-generator Add Morpho protocol\n```\n\nOr generate manually:\n\n```bash\npython scripts/generate_playbook.py \\\n  --protocol morpho_blue \\\n  --contracts \"pool=0xBBBB...\" \\\n  --functions supply,withdraw,borrow,repay\n```\n\n\u003e See [CONTRIBUTING.md](CONTRIBUTING.md) for the full walkthrough, including multi-chain support and fork validation.\n\n## Configuration\n\n```bash\ndefi-skills config setup   # interactive wizard\n```\n\nKey environment variables:\n\n| Variable | Required for |\n|----------|-------------|\n| `WALLET_ADDRESS` | All commands |\n| `ALCHEMY_API_KEY` | On-chain quotes, ENS, balance queries (enable all chains in your Alchemy dashboard) |\n| `ONEINCH_API_KEY` | Token discovery on L2s (Arbitrum, Base, Optimism, Polygon) |\n| `ANTHROPIC_API_KEY` | Chat mode only |\n\n\u003e See [docs/configuration.md](docs/configuration.md) for the full list.\n\n## Safety\n\n- Output is always **unsigned**. The tool never signs or broadcasts.\n- No private keys involved at any stage.\n- All addresses EIP-55 checksummed.\n- DEX operations include on-chain quoting with configurable slippage protection.\n- Resolvers raise errors on failure. Broken transactions are never silently produced.\n\n## Known Limitations\n\n- **6 chains**: Mainnet, Arbitrum, Base, Optimism, Polygon, and Sepolia. Adding a protocol to an existing chain requires only data files. Adding a new chain also requires registering it in `chains.py`.\n- **No gas estimation** -- the signing wallet handles gas and nonce.\n- **Single-hop swaps only** on Uniswap and Balancer.\n- **Static contract addresses** -- protocol upgrades require manual updates to chain resource files.\n\n## Tests\n\n```bash\npip install -e \".[dev]\"\npytest tests/ -v   # fully offline, no API keys needed\n```\n\n## Official Links\nWebsite: https://defi-skills.nethermind.io/\nTelegram Group: https://t.me/defi_skills\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNethermindEth%2Fdefi-skills","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNethermindEth%2Fdefi-skills","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNethermindEth%2Fdefi-skills/lists"}