
Defi Protocol Templates
Need to spin up DeFi contracts without starting from scratch? This generates production-ready Solidity templates for staking rewards, AMM pools, governance tokens, and lending protocols. It handles the tedious boilerplate like reentrancy guards, reward calculations, and liquidity math that you'd otherwise copy from other projects or spend hours debugging. The templates include proper OpenZeppelin imports and follow standard patterns, so you can focus on customizing the business logic instead of wrestling with basic token mechanics. Perfect for hackathons or when you need to prototype DeFi concepts quickly.
- skills.sh installs
- 10.8K
- GitHub stars
- 42.4K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add wshobson/agents --skill defi-protocol-templates --agent claude-codeInstalls into .claude/skills of the current project.
Files
DeFi Protocol Templates
Production-ready templates for common DeFi protocols including staking, AMMs, governance, and flash loans.
When to Use This Skill
- Building staking platforms with reward distribution
- Implementing AMM (Automated Market Maker) protocols
- Creating governance token systems
- Integrating flash loan functionality
Staking Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract StakingRewards is ReentrancyGuard, Ownable {
IERC20 public stakingToken;
IERC20 public rewardsToken;
uint256 public rewardRate = 100; // Rewards per second
uint256 public lastUpdateTime;
uint256 public rewardPerTokenStored;
mapping(address => uint256) public userRewardPerTokenPaid;
mapping(address => uint256) public rewards;
mapping(address => uint256) public balances;
uint256 private _totalSupply;
Sponsors
Details
- Repository
- github.com/wshobson/agents
- Categories
- Finance & Trading, Web3 & Blockchain
More from wshobson/agents
All 174- Team Composition Analysis10.7K
- Mtls Configuration10.7K
- On Call Handoff Patterns10.7K
- Service Mesh Observability10.7K
- Track Management10.7K
- Bazel Build Optimization10.6K
- Istio Traffic Management10.6K
- Nft Standards10.6K
- Linkerd Patterns10.6K
- Parallel Debugging10.4K
- Parallel Feature Development10.3K
- Task Coordination Strategies10.2K
- Multi Reviewer Patterns10.2K
- Team Communication Protocols10K
- Team Composition Patterns10K
- Evaluation Methodology7.6K
- Hads6.9K
- Block No Verify Hook6.9K
- Signed Audit Trails Recipe6.7K
- Protect Mcp Setup6.3K
- Review Agent Setup5.6K
- Scan5K
- Recsys Pipeline Architect4.6K
- Social Publishing4K