Hackathon Timeline: 13 Days Goal: Working MVP with Demo-Ready Features
- Stage 1: Research & Planning (Days 1-2)
- Stage 2: Development Environment Setup (Day 2-3)
- Stage 3: Core Smart Contract Development (Days 3-7)
- Stage 4: Integration & Testing (Days 8-9)
- Stage 5: Frontend Development (Days 10-11)
- Stage 6: Documentation & Presentation (Days 12-13)
Deeply understand Pendle mechanics, Octant architecture, and define technical specifications.
- Read Pendle documentation: https://docs.pendle.finance/
- Understand PT (Principal Token) and YT (Yield Token) mechanics
- Study Pendle Router contract functions:
mintPyFromToken()- splits assets into PT + YTswapExactYtForToken()- sells YT for fixed yieldredeemPyToToken()- redeems matured PT
- Analyze existing Pendle integrations on GitHub
- Identify mainnet Pendle contracts for stETH:
- Pendle Router address
- stETH market address
- PT-stETH and YT-stETH token addresses
- Calculate example scenarios:
- 100 ETH → stETH → Pendle split → YT sale price
- Expected fixed yield rates (check current market rates)
Deliverable: Document pendle-mechanics.md with contract addresses and function signatures
- Clone Octant v2 repository: https://github.com/golemfoundation/octant
- Study Octant smart contracts:
- Vault architecture (ERC-4626 compliance)
- PaymentSplitter for yield distribution
- Deposit and withdrawal flows
- Identify integration points for custom yield strategies
- Review Octant's security considerations and audit reports
- Join Octant Discord/Telegram for technical questions
Deliverable: Document octant-integration-points.md
- Define smart contract architecture:
PendleFixedYieldVault (main vault) ├── YieldLockManager (manages PT positions) ├── FixedYieldDistributor (distributes to public goods) └── Interfaces to Pendle Router - Create data flow diagram:
- User deposits ETH → stETH conversion → Pendle split → YT sale → yield distribution
- Define key parameters:
- Minimum deposit amount
- PT maturity periods (3, 6, 12 months)
- Slippage tolerance for YT sales
- Emergency withdrawal mechanisms
- List external dependencies:
- Lido stETH contract
- Pendle Router and Market contracts
- Chainlink price feeds (if needed)
- Uniswap V3 (backup liquidity)
Deliverable: Complete technical-specification.md with architecture diagrams
- Identify potential risks:
- Smart contract vulnerabilities
- Pendle protocol risks
- stETH depeg scenarios
- YT liquidity issues
- PT maturity handling edge cases
- Define mitigation strategies for each risk
- Plan security measures:
- Access control (Ownable/AccessControl)
- Pausability for emergencies
- Reentrancy guards
- SafeERC20 for token transfers
Deliverable: risk-assessment.md document
Set up complete development environment with testing infrastructure.
- Install Foundry:
curl -L https://foundry.paradigm.xyz | bash foundryup - Create project structure:
forge init pendle-fixed-yield cd pendle-fixed-yield - Configure
foundry.toml:[profile.default] src = "src" out = "out" libs = ["lib"] solc = "0.8.23" optimizer = true optimizer_runs = 200 via_ir = true [rpc_endpoints] mainnet = "${MAINNET_RPC_URL}" [etherscan] mainnet = { key = "${ETHERSCAN_API_KEY}" }
- Set up
.envfile:MAINNET_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY ETHERSCAN_API_KEY=your_key PRIVATE_KEY=your_test_key
Deliverable: Initialized Foundry project
- Install OpenZeppelin contracts:
forge install OpenZeppelin/openzeppelin-contracts
- Install Solmate (efficient ERC-4626):
forge install transmissions11/solmate
- Install Pendle contracts (for interfaces):
forge install pendle-finance/pendle-core-v2-public
- Create remappings in
foundry.toml:remappings = [ "@openzeppelin/=lib/openzeppelin-contracts/", "@solmate/=lib/solmate/src/", "@pendle/=lib/pendle-core-v2-public/contracts/" ]
Deliverable: All dependencies installed and importable
- Create fork testing script
test/Fork.t.sol:pragma solidity ^0.8.23; import "forge-std/Test.sol"; contract ForkTest is Test { uint256 mainnetFork; function setUp() public { mainnetFork = vm.createFork(vm.envString("MAINNET_RPC_URL")); vm.selectFork(mainnetFork); } }
- Test fork functionality:
forge test --fork-url $MAINNET_RPC_URL -vv
- Verify access to mainnet contracts:
- Read stETH balance of Lido contract
- Fetch Pendle market data
Deliverable: Working mainnet fork for testing
- Create organized folder structure:
pendle-fixed-yield/ ├── src/ │ ├── PendleFixedYieldVault.sol │ ├── YieldLockManager.sol │ ├── FixedYieldDistributor.sol │ ├── interfaces/ │ │ ├── IPendleRouter.sol │ │ ├── IPendleMarket.sol │ │ └── IStETH.sol │ └── libraries/ │ └── PendleHelpers.sol ├── test/ │ ├── unit/ │ ├── integration/ │ └── fork/ ├── script/ │ ├── Deploy.s.sol │ └── Interactions.s.sol └── docs/ - Create placeholder files with SPDX and pragma statements
Deliverable: Complete project structure
Build the three core smart contracts with comprehensive functionality.
- Create
interfaces/IPendleRouter.sol:interface IPendleRouter { function mintPyFromToken( address receiver, address YT, uint256 minPyOut, TokenInput calldata input ) external returns (uint256 netPyOut); function swapExactYtForToken( address receiver, address market, uint256 exactYtIn, TokenOutput calldata output ) external returns (uint256 netTokenOut, uint256 netSyFee); function redeemPyToToken( address receiver, address YT, uint256 netPyIn, TokenOutput calldata output ) external returns (uint256 netTokenOut); }
- Create
interfaces/IStETH.solfor Lido interactions - Create
interfaces/IPendleMarket.solfor market data - Create
interfaces/IOctantDistributor.solfor Octant integration
Deliverable: Complete interface files
- Implement ERC-4626 compliant vault structure:
contract PendleFixedYieldVault is ERC4626, Ownable, ReentrancyGuard, Pausable { using SafeERC20 for IERC20; // State variables IStETH public immutable stETH; IPendleRouter public immutable pendleRouter; YieldLockManager public yieldLockManager; FixedYieldDistributor public yieldDistributor; // Events event Deposited(address indexed user, uint256 ethAmount, uint256 shares); event YieldLocked(uint256 ytAmount, uint256 fixedYield, uint256 maturity); event PTRedeemed(uint256 ptAmount, uint256 stETHReceived); }
- Implement deposit function:
- Accept ETH deposits
- Convert ETH to stETH via Lido
- Mint vault shares proportionally
- Emit events
- Implement
_lockYield()internal function:- Split stETH into PT + YT via Pendle
- Sell YT tokens for fixed yield
- Transfer fixed yield to distributor
- Store PT position in YieldLockManager
- Implement withdrawal function:
- Calculate user's share of vault
- Handle PT maturity (redeem if matured, or withdraw available stETH)
- Burn vault shares
- Add emergency functions:
pause()/unpause()- Emergency withdrawal mechanism
- Update critical addresses (with timelock in production)
Deliverable: Complete PendleFixedYieldVault.sol (300-400 lines)
- Create PT position tracking structure:
struct PTPosition { address ptToken; uint256 amount; uint256 maturity; bool redeemed; uint256 depositedAt; } contract YieldLockManager is Ownable { mapping(uint256 => PTPosition) public positions; uint256 public positionCount; uint256[] public maturities; // Track different maturity dates mapping(uint256 => uint256) public totalPTByMaturity; }
- Implement position management:
addPosition()- called by vault when creating PT positiongetMaturedPositions()- returns redeemable PTsmarkRedeemed()- marks PT as redeemedgetTotalLockedValue()- calculates total locked in PTs
- Implement laddering strategy:
- Distribute deposits across 3, 6, 12-month maturities
- Balance allocation based on available markets
- Auto-select next maturity date
- Add view functions:
getUpcomingMaturities()- returns maturity dates in next 30 daysgetPositionsByMaturity(uint256 maturity)- filter positionscalculateRedeemableAmount()- how much can be withdrawn
Deliverable: Complete YieldLockManager.sol (200-300 lines)
- Implement yield collection and distribution:
contract FixedYieldDistributor is Ownable, ReentrancyGuard { IERC20 public immutable stETH; // Octant integration address public octantPaymentSplitter; // Yield tracking uint256 public totalYieldCollected; uint256 public totalYieldDistributed; mapping(address => uint256) public publicGoodsAllocations; event YieldReceived(uint256 amount, uint256 timestamp); event YieldDistributed(address indexed recipient, uint256 amount); }
- Implement
receiveYield()function:- Accept yield from vault (when YT is sold)
- Update accounting
- Emit events
- Implement
distributeToPublicGoods():- Interface with Octant's PaymentSplitter
- Handle multiple recipient addresses
- Track distribution history
- Add analytics functions:
getFixedYieldRate()- calculate annualized fixed rategetYieldHistory()- historical yield datagetPredictedYield(uint256 timeframe)- forecast based on locked positions
Deliverable: Complete FixedYieldDistributor.sol (150-200 lines)
- Create
libraries/PendleHelpers.sol:library PendleHelpers { // Calculate expected YT sale proceeds function calculateYTValue( address market, uint256 ytAmount ) internal view returns (uint256); // Determine optimal maturity date function selectOptimalMaturity( address[] memory availableMarkets ) internal view returns (address bestMarket, uint256 maturity); // Calculate fixed yield rate function calculateFixedRate( uint256 ytSaleProceeds, uint256 principal, uint256 timeToMaturity ) internal pure returns (uint256 annualizedRate); }
- Implement slippage protection helpers
- Implement maturity date calculation utilities
Deliverable: Complete helper library
Comprehensive testing with mainnet fork and edge case handling.
- Test
PendleFixedYieldVault.sol:// test/unit/PendleFixedYieldVault.t.sol contract PendleFixedYieldVaultTest is Test { function testDeposit() public { } function testWithdrawal() public { } function testYieldLocking() public { } function testEmergencyPause() public { } function testAccessControl() public { } }
- Test deposit with various ETH amounts (0.1, 1, 10, 100 ETH)
- Test withdrawal scenarios (partial, full, before maturity, after maturity)
- Test share calculation accuracy
- Test reentrancy protection
- Test pause/unpause functionality
- Test ownership and access control
- Test
YieldLockManager.sol:- Test position creation and tracking
- Test maturity date selection
- Test laddering across multiple maturities
- Test position redemption marking
- Test view function accuracy
- Test
FixedYieldDistributor.sol:- Test yield receipt and accounting
- Test distribution to multiple recipients
- Test rate calculations
- Test historical tracking
- Run tests:
forge test -vvv - Ensure >90% code coverage:
forge coverage
Deliverable: Comprehensive unit test suite with >90% coverage
- Create integration test with real Pendle contracts:
// test/integration/FullFlow.t.sol contract FullFlowIntegrationTest is Test { function setUp() public { // Fork mainnet vm.createSelectFork(vm.envString("MAINNET_RPC_URL")); // Deploy contracts vault = new PendleFixedYieldVault(...); // Setup with real Pendle addresses } function testFullDepositToDistribution() public { // 1. Deposit ETH // 2. Verify stETH conversion // 3. Verify Pendle split // 4. Verify YT sale // 5. Verify yield distribution // 6. Wait until maturity (vm.warp) // 7. Withdraw } }
- Test with real stETH from mainnet
- Test with real Pendle markets (use actual market addresses)
- Verify YT sale on real Pendle AMM
- Test PT redemption after maturity (use
vm.warpto time-travel) - Test with different maturity dates (3, 6, 12 months)
- Verify gas costs for each operation
Deliverable: Working integration tests on mainnet fork
- Test edge cases:
- Zero deposits (should revert)
- Dust amounts (<0.01 ETH)
- Very large deposits (>1000 ETH)
- Withdrawal before any PT matures
- Simultaneous multiple user deposits
- YT sale with insufficient liquidity
- stETH depeg scenarios (simulate with mock)
- Pendle market paused/disabled
- PT redemption when market no longer exists
- Test failure modes:
- What happens if YT sale fails?
- What if Pendle Router is paused?
- What if stETH contract is upgraded?
- Test arithmetic edge cases:
- Share calculation rounding
- Division by zero protection
- Integer overflow protection (should not happen with 0.8.x but verify)
Deliverable: Edge case test suite
- Run gas reports:
forge test --gas-report - Optimize storage layout:
- Pack variables to minimize storage slots
- Use
immutablefor constants set in constructor - Use
calldatainstead ofmemoryfor external function parameters
- Optimize loops and calculations
- Target gas costs:
- Deposit: <300k gas
- Withdrawal: <250k gas
- Yield lock: <400k gas
- Document gas costs in
GAS_REPORT.md
Deliverable: Gas-optimized contracts
- Self-audit checklist:
- All external calls use checks-effects-interactions pattern
- SafeERC20 used for all token transfers
- Reentrancy guards on all state-changing functions
- Access control on admin functions
- No delegatecall to untrusted contracts
- Integer overflow/underflow protections
- Proper event emission for all critical actions
- No hardcoded addresses (use constructor/setter)
- Pausing mechanism for emergencies
- Time-based logic handles edge cases (block.timestamp)
- Run Slither static analysis:
pip3 install slither-analyzer slither . - Fix all critical and high severity issues
- Document remaining warnings and justify
Deliverable: Security audit report and Slither results
Build simple, functional UI for demo purposes.
- Initialize Next.js + RainbowKit + wagmi:
npx create-rainbowkit@latest pendle-fixed-yield-ui cd pendle-fixed-yield-ui - Install additional dependencies:
npm install ethers viem@^2 @tanstack/react-query npm install recharts # for charts npm install date-fns # for date formatting
- Configure RainbowKit for Ethereum mainnet and testnet
- Set up environment variables in
.env.local:NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_project_id NEXT_PUBLIC_ALCHEMY_API_KEY=your_key NEXT_PUBLIC_VAULT_ADDRESS=deployed_vault_address
Deliverable: Initialized frontend project
- Generate TypeScript types from ABIs:
npx typechain --target ethers-v6 --out-dir ./types '../out/PendleFixedYieldVault.sol/PendleFixedYieldVault.json' - Create contract hooks in
hooks/useVault.ts:export function useVaultDeposit() { const { writeContract } = useWriteContract(); const deposit = async (amount: bigint) => { return writeContract({ address: VAULT_ADDRESS, abi: VaultABI, functionName: 'deposit', value: amount, }); }; return { deposit }; }
- Create hooks for:
useVaultDeposit()useVaultWithdraw()useVaultBalance()useFixedYieldRate()usePositions()
Deliverable: Contract integration hooks
- Create deposit component (
components/Deposit.tsx):export function Deposit() { const [amount, setAmount] = useState(''); const { deposit, isLoading } = useVaultDeposit(); return ( <div className="card"> <h2>Deposit ETH</h2> <input type="number" value={amount} onChange={(e) => setAmount(e.target.value)} placeholder="Amount in ETH" /> <button onClick={() => deposit(parseEther(amount))}> {isLoading ? 'Depositing...' : 'Deposit'} </button> </div> ); }
- Create withdrawal component (
components/Withdraw.tsx) - Create dashboard component (
components/Dashboard.tsx):- Display total deposited
- Show vault shares owned
- Display current fixed yield rate
- Show upcoming maturity dates
- Display total yield distributed to public goods
- Create positions table (
components/PositionsTable.tsx):- List all PT positions
- Show maturity dates
- Display amounts locked
- Show status (locked/matured/redeemed)
Deliverable: Core UI components
- Create yield rate chart (
components/YieldChart.tsx):- Compare fixed yield vs variable DeFi yields
- Show historical fixed rates locked
- Display predicted yield over time
- Create maturity timeline (
components/MaturityTimeline.tsx):- Visual timeline of upcoming PT maturities
- Show amounts maturing at each date
- Create public goods impact display:
- Total funding provided to public goods
- Number of projects supported
- Funding predictability metrics
Deliverable: Data visualization components
- Design main layout:
// app/page.tsx export default function Home() { return ( <main className="container mx-auto p-4"> <Header /> <div className="grid grid-cols-1 md:grid-cols-2 gap-4"> <Deposit /> <Withdraw /> </div> <Dashboard /> <YieldChart /> <PositionsTable /> </main> ); }
- Implement responsive design (mobile, tablet, desktop)
- Add Tailwind CSS styling for clean UI
- Add loading states and error handling
- Add transaction notifications (success/error)
- Test on different screen sizes
Deliverable: Complete, responsive UI
Create compelling documentation and demo materials for judges.
- Create comprehensive
README.md:# Pendle Fixed Yield Strategy for Octant ## Overview Transform unpredictable DeFi yields into guaranteed, fixed returns for sustainable public goods funding. ## The Problem [Explain the predictability problem] ## Our Solution [Explain Pendle yield tokenization] ## Architecture [Include diagrams] ## Smart Contracts [Document each contract] ## Installation [Setup instructions] ## Usage [How to interact with contracts and UI] ## Security [Security considerations and audit status] ## Deployed Contracts [Addresses on testnet/mainnet]
- Create
ARCHITECTURE.mdwith detailed technical design - Create
INTEGRATION_GUIDE.mdfor Octant integration - Document all public functions with NatSpec comments:
/// @notice Deposits ETH and receives vault shares /// @param amount The amount of ETH to deposit /// @return shares The number of vault shares minted function deposit(uint256 amount) external returns (uint256 shares);
Deliverable: Complete technical documentation
- Create user guide (
docs/USER_GUIDE.md):- How to deposit
- Understanding fixed yields
- How withdrawals work
- Understanding PT maturities
- FAQ section
- Create demo walkthrough script
- Create troubleshooting guide
Deliverable: User-friendly documentation
- Deploy contracts to testnet (Sepolia or Goerli):
forge script script/Deploy.s.sol --rpc-url $TESTNET_RPC --broadcast --verify - Verify contracts on Etherscan
- Deploy frontend to Vercel:
vercel --prod
- Create demo scenario:
- Connect wallet
- Deposit 1 ETH
- Show fixed yield locked (e.g., 8% guaranteed for 6 months)
- Show PT position created
- Display yield distribution to public goods
- Compare with variable yield chart
- Show maturity timeline
- Record demo video (3-5 minutes):
- Problem statement (30 sec)
- Solution explanation (1 min)
- Live demo (2 min)
- Impact on public goods (1 min)
- Technical highlights (30 sec)
- Prepare backup demo (in case of network issues):
- Screenshots of each step
- Pre-recorded video
Deliverable: Working demo on testnet and demo video
- Create pitch deck (10-15 slides):
- Title slide with team
- Problem: Unpredictable funding kills public goods sustainability
- Existing solutions and their shortcomings
- Our solution: Pendle yield tokenization
- How Pendle works (visual diagram)
- Architecture overview
- Smart contract flow diagram
- Key features and benefits
- Security considerations
- Scalability (Pendle $6B TVL)
- Integration with Octant
- Live demo
- Impact metrics
- Roadmap (post-hackathon)
- Thank you + Q&A
- Create technical deep-dive slides for judges:
- Contract architecture
- Gas optimization strategies
- Security measures
- Testing approach
- Prepare 5-minute pitch script
- Practice presentation (time yourself)
Deliverable: Complete pitch deck and script
- Code cleanup:
- Remove console.log statements
- Remove commented-out code
- Ensure consistent formatting (run
forge fmt) - Update all TODOs and FIXMEs
- Final testing:
- Run full test suite:
forge test - Run gas report:
forge test --gas-report - Run coverage:
forge coverage - Test UI on different browsers
- Test wallet connection (MetaMask, Coinbase Wallet, WalletConnect)
- Run full test suite:
- Create submission package:
- GitHub repository (public)
- README with clear setup instructions
- Link to deployed demo
- Link to demo video
- Link to presentation deck
- Prepare for Q&A:
- Anticipate judge questions
- Prepare answers about:
- Why Pendle over other fixed yield protocols?
- Security considerations
- Scalability limitations
- Integration timeline with Octant
- What happens if Pendle market liquidity dries up?
- How do you handle stETH depeg?
Deliverable: Submission-ready package
// Lido
stETH: 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84
// Pendle (as of 2024 - verify latest)
Pendle Router: 0x00000000005BBB0EF59571E58418F9a4357b68A0
Pendle Oracle: 0x9a9Fa8338dd5E5B2188006f1Cd2Ef26d921650C2
// Example stETH Market (verify current markets)
// Check https://app.pendle.finance/trade/markets for latest
PT-stETH Market: [Check Pendle app for current market address]- Pendle Docs: https://docs.pendle.finance/
- Pendle SDK: https://github.com/pendle-finance/pendle-sdk-core-v2-docs
- Pendle Contracts: https://github.com/pendle-finance/pendle-core-v2-public
- Octant Docs: https://docs.octant.app/
- ERC-4626: https://eips.ethereum.org/EIPS/eip-4626
- Foundry Book: https://book.getfoundry.sh/
- Unit tests passing
- Integration tests passing
- Gas costs acceptable
- Slither security scan clean
- Mainnet fork tests successful
- UI/UX tested on multiple devices
- Demo rehearsed and timed
- Functional deposit/withdrawal flow
- Working Pendle integration (PT/YT split)
- YT sale mechanism functional
- Fixed yield calculation accurate
- PT position tracking working
- Basic UI operational
- Demo-ready on testnet
- Documentation complete
- Understanding complete
- Technical specs defined
- Architecture documented
- Foundry configured
- Dependencies installed
- Fork testing working
- All three core contracts complete
- Helper libraries implemented
- Basic functionality working
- Unit tests >90% coverage
- Integration tests passing
- Security review complete
- UI built and functional
- Contract integration working
- Demo-ready interface
- All docs complete
- Demo prepared and rehearsed
- Submission package ready
Priority 1 (Must Have for MVP):
- PendleFixedYieldVault with deposit/withdrawal
- Basic Pendle integration (PT/YT split)
- Simple UI for deposits
- Basic documentation
Priority 2 (Should Have):
- YieldLockManager with position tracking
- FixedYieldDistributor
- Dashboard with analytics
Priority 3 (Nice to Have):
- Advanced charts and visualizations
- Laddering strategy
- Comprehensive documentation
Pendle Integration Issues:
- Use mock contracts for demo
- Document integration approach
- Show flow diagrams instead of live demo
Deployment Issues:
- Demo on local fork instead of testnet
- Use screenshots and video
- Focus on code quality and documentation
UI Issues:
- Use minimal CLI-based demo
- Focus on smart contract excellence
- Emphasize backend sophistication
- All code committed to GitHub
- README has clear setup instructions
- Demo video uploaded and accessible
- Contracts deployed to testnet (if possible)
- UI deployed and accessible
- Pitch deck finalized
- Team introductions prepared
- Q&A answers prepared
- Submission form filled out
- Double-checked submission deadline
- Add additional test coverage
- Implement advanced features (auto-compounding, etc.)
- Add governance mechanisms
- Prepare for potential mainnet deployment
- Connect with Octant team for integration discussions
- Network with judges and other teams
Good luck building! Remember: A working MVP with excellent documentation beats a feature-rich but incomplete project. Focus on core functionality first!