Innovative DeFi Protocol: Seamlessly split yield-bearing assets into fixed and variable yield components with native Uniswap V4 integration for optimal liquidity and user experience.
Bond Zero revolutionizes the DeFi yield landscape by enabling users to separate yield-bearing tokens (YBT) into two distinct components:
- Principal Tokens (PT): Guaranteed 1:1 redemption for underlying assets at maturity
- Yield Tokens (YT): Rights to all yield generated until maturity
Built on Uniswap V4 Hooks, Bond Zero provides liquidity efficiency, seamless trading experiences, and innovative yield strategies that weren't possible in previous AMM versions.
- Native PT β YBT Trading: Direct swaps without intermediate tokens or complex routing
- Automatic Redemption: Expired PT tokens are automatically redeemed for underlying YBT during swaps
- Zero Slippage for 1:1 Redemptions: Post-maturity PTβYBT swaps execute at exact 1:1 rate
- Atomic Operations: Hook-based execution ensures transaction integrity
- Smart Claim Management: ERC-6909 claim tokens for efficient settlement
- Custom Liquidity Curves: Implements tight concentrated liquidity for optimal PT/YT pricing providing deep liquidity
- Reduced Gas Costs: Single-transaction execution for complex operations through hooks
- Concentrated Liquidity: Flexibilty to use custom price ranges for better capital utilization
Central registry managing bond markets and PT/YT lifecycle:
- Create bond markets with configurable expiry and APR
- Mint PT/YT pairs by depositing YBT (1:1:1 ratio)
- Redeem expired PT tokens for underlying YBT
- Calculate real-time PT/YT pricing based on time-to-maturityUniswap V4 hook providing native AMM integration:
- Automatic PT redemption on expiry
- Security controls preventing invalid swaps
- ERC-6909 claim token managementERC-20 representing future claim on underlying asset:
- Always redeemable 1:1 for YBT at maturity
- Tradeable at discount before maturity
- Present value = 1 / (1 + r*t)ERC-20 representing yield accrual rights:
- Captures all yield until maturity
- Present value = 1 - PT_priceConsider a 1-year wstETH bond market with 10% APR:
YBT (wstETH): 1.000 tokens
Maturity: 365 days
APR: 10%
Expected value at maturity: 1.100 stETH (considering initial rate of wstETH:stETH is 1:1)
PT Price = 1 / (1 + 0.10 Γ 1) = 0.909 stETH
YT Price = 1 - 0.909 = 0.091 stETH
Total = 0.909 + 0.091 = 1.000 stETH
Scenario 1: Risk-Averse User
- Holds PT tokens for guaranteed fixed yield at maturity
- 10% return locked in regardless of actual wstETH yield
Scenario 2: Yield Maximizer
- Holds YT tokens to capture variable yield
- Benefits if wstETH yields > 10%, loses if < 10%
Scenario 3: Arbitrageur
- Uses Uniswap V4 hooks for efficient PT/YT arbitrage
src/
βββ BondZeroMaster.sol # Core bond market management
βββ BondZeroHook.sol # Uniswap V4 hook integration
βββ PrincipalToken.sol # Simple PT ERC-20 implementation
βββ YieldToken.sol # Simple YT ERC-20 implementation
βββ mocks/
βββ MockYieldBearingToken.sol # Testing utilities
# Run all tests
forge test -vvv
# Key test scenarios
- testFullUserJourneyWithHookSwap() # End-to-end workflow
- testCannotSwapYBTForPTWhenExpired() # Security validation
- testPTPricingCalculations() # Mathematical accuracy
- testClaimTokenMechanics() # Settlement verificationβ
Full user journey (536,355 gas)
β
Security controls (234,129 gas)
β
Mathematical precision (Β±0.0001%)
β
Gas optimization (<600k per operation)
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
# Clone repository
git clone https://github.com/sudeepb02/bond-zero
cd bond-zero# Install dependencies
forge install
# Compile contracts
forge build
# Run tests
forge test// Deploy bond market for wstETH with 1-year maturity
bondMaster.createBondMarket(
wstETH_ADDRESS,
stETH_ADDRESS,
block.timestamp + 365 days,
1000 // 10% APR in basis points
);// Deposit 100 wstETH, receive 100 PT + 100 YT
bytes32 marketId = getMarketId(wstETH, stETH, expiry);
bondMaster.mintPtAndYt(marketId, 100e18);// Swap 50 PT for wstETH through hook
IPoolManager.SwapParams memory params = IPoolManager.SwapParams({
zeroForOne: true,
amountSpecified: 50e18,
sqrtPriceLimitX96: 0
});
poolManager.swap(poolKey, params, "");- Fixed Income: Lock in guaranteed returns via PT tokens
- Yield Farming: Amplify yield exposure through YT tokens
- Portfolio Hedging: Separate principal protection from yield risk
- Treasury Management: Predictable cash flows for corporate treasuries
- Risk Management: Isolate and trade different risk components
- Structured Products: Build complex yield derivatives
- Composability: Integrate PT/YT into other DeFi protocols
- Automation: Build yield strategies on top of Bond Zero
- Innovation: Create new financial primitives using hooks
Total Addressable Market:
βββ Yield-bearing assets: $500B+ (wstETH, rETH, stMATIC...)
βββ Fixed income DeFi: $50B+ (traditional bonds, CDs)
βββ Yield trading: $10B+ (Pendle, Element, Sense)
- First Uniswap V4 Implementation: Early mover advantage in hook ecosystem
- Lower Costs: Reduced gas fees through hook efficiency
- Better Liquidity: Native AMM integration vs external DEX dependencies
This project is licensed under the MIT License - see the LICENSE file for details.
This protocol was developed for the ETH New Delhi hackathon, showcasing the potential of Uniswap V4 hooks in creating next-generation DeFi primitives.