Executive Summary
Herafi Protocol provides a structured framework for trading and managing derivative assets in decentralized finance. Through smart contract architecture, Herafi facilitates the creation of synthetic assets backed by diversified collateral pools with optional yield generation and efficient liquidity management.
The protocol offers capital efficiency through multi-collateral derivative tokens, yield optimization for selected assets, and a unified liquidity pool employing adaptive pricing mechanisms. Herafi's architecture is designed to maintain balanced markets during periods of volatility while providing traders, investors, and liquidity providers with multiple participation options.
This whitepaper outlines the technical foundations, economic mechanisms, and strategic direction of the Herafi Protocol.
Introduction
Decentralized Finance (DeFi) has transformed financial services by introducing new approaches to financial primitives. However, the creation and trading of derivative assets remain challenging in DeFi environments due to liquidity fragmentation, capital inefficiency, and complex pricing mechanisms.
Herafi Protocol offers a solution to these challenges through a structured framework for derivative asset management with governance oversight. The protocol enables:
- Creation of multi-collateral derivative tokens representing various financial strategies, indices, or exposure to specific market sectors
- Optional yield generation on selected collateral assets through integration with established lending protocols
- Consolidated liquidity management with adaptive pricing based on token scarcity and demand
- Capital-efficient operations supporting single-token issuance and redemption
Herafi combines these features into an integrated ecosystem that balances security, efficiency, and user experience. The protocol is designed for both sophisticated traders seeking exposure to derivative strategies and users looking for simplified access to diversified assets.
Note: This whitepaper is a work in progress and will be updated as the protocol evolves. The creation of derivative tokens will initially be delegated to the developers and later to the governance. The version 1.0 of the protocol does not allow users to create derivative tokens arbitrarily.
Protocol Overview
Herafi Protocol's architecture consists of three primary components working in harmony:
- HeraPool: The derivative token factory that creates and manages synthetic assets backed by specified collateral ratios
- HeraStrategy: The collateral management layer that optionally enables yield generation for selected assets
- UnifiedLiquidityPool: The liquidity management system that enables capital-efficient operations
Users interact with the protocol through these components to mint, trade, and redeem derivative tokens, provide liquidity, and potentially earn yields. Herafi's design philosophy prioritizes:
- Composability: Components designed to interoperate with the broader DeFi ecosystem
- Capital Efficiency: Multiple pathways for users to participate with reduced slippage
- Risk Management: Pricing models that adjust based on real-time market conditions
- Accessibility: Simplified user experiences that abstract away underlying complexity
The following sections detail each component and mechanism within the Herafi ecosystem.
Core Components
HeraPool: Derivative Token Factory
HeraPool is the foundational component of the Herafi Protocol, responsible for creating and managing derivative tokens. Each HeraPool instance represents a unique derivative asset with specific properties:
- Collateral Composition: A defined set of underlying assets with specific weights
- Base Value: The reference value (typically pegged to USD) for the derivative
- Nominal Units: The representation of how much of each collateral asset backs a single unit of the derivative token
Key capabilities of HeraPool include:
- Derivative Issuance: Users can mint derivative tokens by depositing the required collateral assets according to the specified weights
- Collateral Redemption: Users can burn derivative tokens to retrieve the underlying collateral
- Single-Token Operations: Through integration with the
Unified Liquidity Pool
, users can issue or redeem derivatives using just a single token - Oracle Price Integration: Market prices for accurate valuation and issuance/redemption calculations
The mathematical formulation for derivative token valuation follows:
Where:
- is the nominal unit for collateral asset
- is the market price of collateral asset
- is the number of collateral assets
This ensures that each derivative token maintains a transparent and verifiable value proposition.
HeraStrategy: Collateral Management with Optional Yield Generation
HeraStrategy manages the collateral assets deposited by users when minting derivative tokens. For selected assets, rather than holding them idle, HeraStrategy can deploy them to generate supplementary yields through integration with established lending protocols.
Key features of HeraStrategy include:
- Optional Protocol Integration: Select assets may be deployed to protocols like Aave to generate additional yield
- Share-Based Accounting: User ownership is tracked through a system of shares, ensuring fair distribution
- Evolving Yield Strategy: Initially using external protocols for certain assets, with plans to implement internal yield generation mechanisms in future versions
- Fee Management: A small fee is applied on withdrawals to incentivize long-term holding
The yield distribution mechanism follows a share-based model represented by:
Where:
- is the number of shares owned by a user
- is the current total value of all assets (including yield)
- is the total number of shares across all users
This approach ensures that yields are automatically compounded and fairly distributed among all derivative token holders.
Unified Liquidity Pool: Liquidity Framework
The Unified Liquidity Pool represents a departure from traditional liquidity pool models. Unlike conventional automated market makers (AMMs) that require separate pools for each trading pair, Herafi consolidates all supported tokens into a single unified pool.
Key Differences from Traditional Liquidity Pools:
Feature | Traditional AMMs | Herafi UnifiedLiquidityPool |
---|---|---|
Pool Structure | Separate pools per token pair | Single unified pool for all tokens |
LP Token Valuation | Based on specific pool assets | Based on USD value of entire pool |
Price Mechanism | Fixed mathematical curves | Oracle-based pricing with dynamic fees |
Token Exchange | Limited to pairs in the same pool | Any supported token to any other in a single swap |
Liquidity Removal | Only in proportion to pool assets | Flexible single or multi-token options |
Unified Pool Structure
The Unified Liquidity Pool holds all supported tokens in a single pooled liquidity structure. This approach offers several advantages:
- Improved Capital Efficiency: Liquidity is shared across all token pairs rather than being fragmented across multiple pools
- Reduced Slippage: Single-hop trades between any supported tokens, eliminating the need for multi-hop routes
- Simplified Liquidity Provision: Users deposit any supported token and receive LP tokens representing ownership in the entire pool
Oracle-Based Pricing
Unlike traditional AMMs that use mathematical formulas to determine exchange rates, the Unified Liquidity Pool relies on oracle price feeds:
- Price Determination: Token prices are derived from trusted oracles
- Swap Calculation: When swapping Token A for Token B, the protocol:
- Gets oracle prices for both tokens
- Converts Token A amount to USD value
- Applies applicable fees
- Converts USD value to Token B amount
This approach eliminates price divergence between the pool and the broader market, while the scarcity-based multiplier system affects fees rather than the core price itself.
Dollar-Based Share Calculation
When providing liquidity, a user's share is calculated based on the USD value of their deposit relative to the total pool value:
For the first deposit (empty pool):
For subsequent deposits:
This dollar-based approach allows users to provide liquidity in any supported token while maintaining fair representation of their contribution to the pool.
Scarcity-Based Incentives
The protocol implements a dynamic multiplier system to incentivize the provision of scarce tokens:
When a token is scarce (demand exceeds supply), providing that token yields additional value through the multiplier mechanism.
This creates a natural economic incentive for liquidity providers to supply tokens that are most needed by the protocol.
Flexible Liquidity Removal Options
The UnifiedLiquidityPool offers users multiple options for redeeming their LP tokens:
-
Single Token Redemption:
- Users can withdraw their entire share in a single token of choice
- Higher fees apply, especially for scarce tokens
- Base fee: 1% + additional scarcity-based fee
-
Multi-Token Redemption:
- Users can withdraw in multiple tokens with specified distribution
- Lower overall fees compared to single-token redemption
- Base fee: 0.3% + smaller scarcity-based fee
This flexibility allows users to optimize for their specific needs while the fee structure protects the pool from imbalances.
Derivative Token Mechanics
Herafi's derivative tokens represent the core value proposition of the protocol, enabling users to gain exposure to custom-defined baskets of assets.
Multi-Collateral Backing
Each derivative token is backed by a specified basket of collateral assets with:
- Weight Distribution: The percentage of total value allocated to each asset
- Nominal Units: The specific quantity of each asset that backs a single derivative token
- Base Value: The reference value that governs the overall pricing
For example, a derivative token might represent:
- 60% WETH (weight: 0.6)
- 30% WBTC (weight: 0.3)
- 10% USDC (weight: 0.1)
The weights must always sum to 100% (or 1.0 in decimal representation), ensuring full collateralization of the derivative token.
The protocol calculates the nominal units for each asset based on:
Where:
- is the nominal unit for asset
- is the weight assigned to asset
- is the target value of the derivative token
- is the price of asset
- is the decimals of asset
This calculation ensures that the portfolio maintains the desired weight distribution while accounting for the different decimal precision of various assets.
Issuance and Redemption
The standard issuance process requires users to deposit the exact ratio of collateral assets defined by the derivative token.
For a derivative with a base value of $100:
- User deposits collateral assets according to weights and nominal units
- The corresponding amount of derivative tokens is minted
- Collateral is deployed to yield-generating strategies
Redemption reverses this process:
- User burns derivative tokens
- Collateral assets (plus accumulated yield) are withdrawn from strategies
- User receives the underlying collateral according to the current nominal units
This mechanism ensures the derivative token maintains its defined value proposition through direct collateralization.
Single-Token Operations
Herafi's most innovative feature is the ability to issue or redeem derivative tokens using a single collateral type, removing the friction of assembling the exact collateral basket:
Single-Token Issuance:
- User deposits a single supported token
- The Unified Liquidity Pool automatically converts the single token into the required collateral ratio
- Derivative tokens are minted and provided to the user
The formula for calculating the derivative amount from a single input token is:
Single-Token Redemption:
- User burns derivative tokens
- Underlying collateral assets are redeemed from strategies
- The Unified Liquidity Pool converts the collateral basket to the requested single token
- User receives the single token type
This mechanism dramatically simplifies user experience while maintaining the economic properties of the derivative token through the dynamic pricing in the Unified Liquidity Pool.
Protocol Operation: User Flow Example
The following example illustrates the typical user journey within the Herafi Protocol, demonstrating how the components interact to deliver the core value proposition.
Multi-Asset Exposure Through Derivative Tokens
Consider an investor named Alice who seeks exposure to multiple digital assets without the complexity of managing each position individually. Alice decides to purchase hDefi, a derivative token representing a basket of DeFi protocol tokens.
Step 1: Derivative Token Acquisition
Alice initiates a transaction to acquire hDefi tokens using 1,000 USDC as the input token. Based on the current derivative token valuation, Alice receives 10 hDefi tokens. The Herafi Protocol, through the UnifiedLiquidityPool and HeraPool components, automatically:
- Accepts Alice's 1,000 USDC deposit
- Herafi converts the USDC into the appropriate proportions of collateral tokens according to the hDefi derivative specification
- Issues 10 hDefi tokens to Alice's wallet
Step 2: Collateral Management
Behind the scenes, the HeraStrategy contract manages the collateral tokens representing Alice's position:
- Selected tokens are lent through Aave integration, generating yield
- Remaining assets are held in the contract to maintain appropriate liquidity
- Alice's ownership rights are tracked through a share-based accounting system
The protocol maintains transparency regarding which tokens back the derivative and their respective allocations.
Step 3: Market Exposure Benefits
After several hours, market conditions shift, and the underlying assets in the hDefi basket experience price variations. The 10 hDefi tokens, originally valued at 1,041 due to these price movements.
This demonstrates a key benefit of the protocol: Alice has effectively gained exposure to price movements across multiple tokens through a single derivative position, without having to monitor or manage individual holdings.
Step 4: Exit Options
When Alice decides to exit her position, she has multiple options:
- Redeem the hDefi tokens for the underlying collateral assets in their exact proportions
- Redeem for a single asset of her choice (e.g., USDC) by using the UnifiedLiquidityPool
- Sell the hDefi tokens directly to another user
Each redemption method involves different fee structures, with single-asset redemptions typically incurring higher fees than proportional redemptions.
Protocol Governance and Fee Distribution
The governance token of the protocol is Hera. Beyond participating in protocol governance decisions, Hera stakers receive a share of protocol fees, including:
- A percentage of transaction fees from the Unified Liquidity Pool
- Other fees collected through protocol operations
This structure aligns the interests of protocol users, liquidity providers, and governance participants, creating a sustainable ecosystem for decentralized derivative products.
Liquidity Mechanism
The Unified Liquidity Pool serves as the foundation of Herafi's liquidity architecture, employing mechanisms designed to maintain balanced liquidity across all supported tokens while using oracle-based pricing.
Dynamic Scarcity-Based Fee System
Unlike traditional AMMs that derive prices from asset ratios, Herafi uses oracle price feeds for token valuation, while employing a dynamic fee system based on relative token scarcity:
- Token Demand Calculation: For each token, demand is calculated based on its usage across all derivative tokens
- Supply Measurement: The actual balance of each token in the liquidity pool
- Scarcity Multiplier: The ratio of demand to supply, subject to defined constraints
The multiplier affects several aspects of the protocol:
- Swap Fees: Higher fees for scarce output tokens, lower fees for abundant output tokens
- LP Incentives: Enhanced valuation for providing scarce tokens
- Fee Adjustments: Modified fees based on token scarcity/abundance
To prevent abrupt fee changes, a smoothing function is applied:
Where:
- (smoothing factor)
This gradual adjustment mechanism helps maintain fee stability while still responding to changing market conditions.
Adaptive Fee Structure
The fee system in the Unified Liquidity Pool adjusts based on token scarcity to protect liquidity and incentivize balanced token distribution:
-
Base Fee Components:
- Standard swap fee: 0.3%
- Single-token redemption base fee: 1%
- Multi-token redemption base fee: 0.2%
-
Dynamic Adjustments: For token swaps, fees are adjusted using the following components:
Where each component is calculated as:
Constants:
- (0.2 when normalized)
- (higher impact)
- (medium impact)
- (medium-high impact)
- (low impact)
-
Fee Boundaries:
- Minimum fee: 30% of base fee
- Maximum dynamic fee: 0.5%
This adaptive fee structure encourages balanced liquidity by making scarce tokens more expensive to acquire and abundant tokens more attractive to obtain.
Liquidity Provider Incentives
Liquidity providers in Herafi receive several forms of compensation:
- LP Tokens: Representing proportional ownership of the entire liquidity pool based on USD value contributed
- Fee Accrual: 80% of all swap fees generated by the protocol
- Scarcity Bonuses: Enhanced valuation when providing tokens with high demand relative to supply
- Flexible Redemption: Multiple options for exiting positions
This creates a natural incentive to supply tokens that are in high demand by the protocol, helping maintain balanced liquidity.
Yield Generation
An additional benefit of Herafi for select assets is the potential for supplementary yield generation on certain collateral assets, enhancing returns for derivative token holders.
Protocol Integration
For eligible assets, HeraStrategy can deploy them to established lending protocols to generate supplementary yields:
- Selective Aave Integration: Some assets may be deposited into Aave lending pools
- Risk-Managed Approach: Conservative deployment with focus on security over yield maximization
- Future Development: Plans to develop internal yield generation mechanisms to reduce reliance on external protocols
This integration enables certain Herafi derivative tokens to provide additional benefits through yield generation, though this remains a supplementary feature rather than a core component of the protocol's value proposition.
Share-Based Accounting
The protocol employs a sophisticated share-based accounting system to track user ownership:
- Initial Deposit: User receives shares proportional to their deposit
- Yield Accrual: As the total asset value increases through yield generation, the share value increases
- Redemption: User redeems shares for the current equivalent value of assets
For the first deposit of an asset, shares are minted 1:1 with the deposit amount. For subsequent deposits, shares are calculated as:
This system ensures that:
- Yields are fairly distributed among all participants
- New deposits don't dilute existing participants' yields
- Withdrawals don't affect the yield rate for remaining participants
Yield Distribution
Yields generated through strategy deployment automatically accrue to derivative token holders through the increasing value of the collateral backing their tokens:
- Automatic Compounding: Yields are continuously reinvested
- Transparent Accrual: The increasing value of shares reflects yield accumulation
- Fee Split: A small portion of yield (0.5%) is retained as a protocol fee
When redeeming, the protocol calculates the tokens owed based on:
A withdrawal fee of 0.5% is applied during redemption:
This mechanism ensures that derivative token holders benefit from yield without active management, enhancing the overall value proposition of Herafi derivative tokens.
Mathematical Formulations
Derivative Valuation Model
The valuation model for Herafi derivative tokens follows a weighted basket approach with defined nominal units for each collateral asset.
1. Initialization of Nominal Units:
When a new HeraPool is created, nominal units for each collateral asset are calculated:
Where:
- is the nominal unit for asset (in asset's native decimals)
- is the weight assigned to asset (normalized to sum to 1)
- is the target value of the derivative token (typically 1 USD in 1e18 precision)
- is the current price of asset (from oracle)
- is the decimal precision of asset
2. Pool Value Calculation:
The value of the derivative token is calculated as:
3. Single-Token Issuance Calculation:
When issuing with a single token:
Where:
Token Demand Calculation
Token demand is calculated by considering usage across all derivative tokens:
Where:
- is the number of derivative tokens using this token
- is the total supply of a derivative token
- is the calculated value of the derivative token
- is the weight of the token in the derivative
- is the decimal precision of the token
- is the decimal precision of the derivative token
- is the current price of the token
This calculation represents how much of each token would be needed to fully collateralize all derivative tokens directly.
Dynamic Multiplier System
The multiplier system drives the dynamic fee mechanism:
1. Basic Multiplier Calculation:
2. Multiplier Constraints:
Where:
- 0.9 represents a 10% discount for abundant tokens
- 1.2 represents the maximum multiplier (20% premium)
3. Smoothed Multiplier Update:
Where:
- 800 is the smoothing factor (80%)
- 200 is the complement of the smoothing factor (20%)
- 1000 is the smoothing precision
Fee Calculation Framework
The UnifiedLiquidityPool implements a fee system with dynamic adjustments based on token scarcity:
1. Swap Fee Calculation:
Where:
- (30 in 10000 precision)
Component calculations:
2. Single-Token Redemption Fee:
3. Multi-Token Redemption Fee:
Share-Based Yield Distribution
HeraStrategy implements a share-based accounting system for select assets with yield generation:
1. Share Calculation for Deposits:
2. Asset Calculation for Redemption:
3. Protocol Fee Calculation:
This accounting system ensures yields are distributed proportionally based on ownership shares.
Economic Security
Herafi Protocol incorporates multiple safeguards to ensure economic security and protect users from potential risks.
Oracle Dependency
Price oracles are critical for accurate valuation and operations:
- Oracle Implementation: Herafi relies on trusted price feed oracles
- Fallback Mechanisms: Systems to handle oracle failures or inconsistencies
- Price Validation: Checks for extreme price movements
The protocol acknowledges oracle dependency as an inherent risk and employs multiple validation layers to mitigate potential issues.
Risk Mitigation
Herafi employs several strategies to minimize risks:
- Full Collateralization: All derivative tokens are fully backed by collateral
- Slippage Controls: Parameters to prevent excessive price impact
- Dynamic Fee Adjustments: Increased fees during market stress to protect liquidity
- Minimum Liquidity Requirements: Thresholds to ensure sufficient liquidity
These mechanisms work together to create a resilient system that can withstand market volatility.
Slippage Protection
To protect users from unexpected price movements:
- Minimum Output Parameters: Users specify minimum acceptable output for all operations
- Slippage Tolerance: Configurable parameters to control acceptable price impact
- Transaction Reversion: Operations revert if slippage exceeds tolerance
- Transparent Pricing: Pre-execution estimates of expected output
The protocol incorporates a slippage tolerance parameter (default 1000, or 1%) that can be adjusted by governance:
Where:
- (10%)
These protections ensure that users remain in control of their transaction execution even in volatile market conditions.
Governance and Fees
Herafi's governance structure and fee system are designed to align incentives among all stakeholders.
Governance Structure
The protocol features a role-based access control system with planned transitional governance:
- Admin Role: Initially held by the development team with authority to add new tokens, adjust parameters, and upgrade components
- Derivative Controller Role: Initially centralized, allowing the team to carefully design and deploy derivative tokens
- Fee Claimer Role: Authority to claim accumulated protocol fees
The creation of derivative tokens will initially be managed by the development team to ensure quality, security, and market fit. As the protocol matures, control will gradually transition to governance, allowing for community participation in the derivative creation process and other protocol decisions.
Fee Distribution
Fees generated by the protocol are distributed according to predetermined allocations:
- Liquidity Provider Fees: 80% of trading fees accrue to liquidity providers
- Protocol Fees: 20% of trading fees plus 0.5% of yield redirected to protocol treasury
- Performance Fees: Charged on yield withdrawals to incentivize long-term holding
The fee split ratio is configurable by governance but defaults to:
Where:
- (80%)
This fee structure incentivizes liquidity provision while generating sustainable revenue for protocol development and maintenance.
Future Roadmap
Herafi Protocol's vision extends beyond its current implementation:
- Expanded Derivative Types: Introduction of more complex derivative structures
- Internal Yield Generation: Development of protocol-native yield strategies to reduce reliance on external protocols
- Cross-Chain Deployment: Expansion to multiple blockchain networks
- Governance Transition: Gradual shift from centralized control to community governance
- Enhanced Analytics: Advanced tools for tracking performance and risk
- Institutional Features: Compliance tools for regulated entities
This roadmap reflects Herafi's commitment to becoming the premier platform for secure, well-designed decentralized derivatives with strong governance oversight.
Conclusion
Herafi Protocol presents an approach to decentralized finance by combining derivative token creation, selective yield generation, and unified liquidity management. The protocol addresses challenges in the current DeFi landscape through:
- Improved Capital Efficiency: Consolidated liquidity and single-token operations
- Simplified User Experience: Reduced complexity while maintaining functionality
- Aligned Economic Incentives: Balanced mechanism design
- Adaptable Architecture: Foundation for supporting various derivative strategies
By building on established DeFi concepts while introducing distinct mechanisms, Herafi creates a structured ecosystem for creating, trading, and optimizing derivative assets. As the protocol develops, it aims to provide additional capabilities for financial innovation in the decentralized economy.
Disclaimer
This whitepaper is for informational purposes only and does not constitute financial, legal, or investment advice. The Herafi Protocol, its derivative tokens, and all associated mechanisms described herein involve substantial risk and are subject to market volatility, technical vulnerabilities, and regulatory uncertainty.
The protocol design and functionality are subject to change through development iterations and governance decisions. Prospective users must conduct their own due diligence before interacting with the protocol. The protocol developers make no representations regarding future performance, regulatory compliance, or investment outcomes.