HedgerPool

HedgerPool: EUR/USD Hedging & Collateral Management

πŸ“‹ Overview

The HedgerPool is the contract responsible for managing EUR/USD hedging positions in the Quantillon protocol. It allows the designated hedger to provide delta-neutral coverage, maintaining QEURO peg stability while generating revenue.

MVP Implementation: The MVP uses a single hedger model to simplify operations. Multi-hedger support is planned for future phases.


πŸ—οΈ Contract Architecture

Inheritance

contract HedgerPool is 
    Initializable,
    ReentrancyGuardUpgradeable,
    AccessControlUpgradeable,
    PausableUpgradeable,
    SecureUpgradeable

External Dependencies

Contract
Role

IERC20 usdc

Collateral token

IChainlinkOracle oracle

Real-time EUR/USD price

IYieldShift yieldShift

Yield distribution

IQuantillonVault vault

Mint/redeem synchronization

ITimeProvider TIME_PROVIDER

Time management (testability)


πŸ” Roles & Permissions

Role
Responsibilities

DEFAULT_ADMIN_ROLE

General administration, role assignment

GOVERNANCE_ROLE

Pool parameter modification

EMERGENCY_ROLE

Emergency position closure

HEDGER_ROLE

Hedging operations (assigned to single hedger)

onlyVault Modifier

Certain functions can only be called by the Vault during mint/redeem operations.


πŸ“Š Single Hedger Model

Configuration

Assignment Flow


πŸ“ˆ Position Structure

HedgePosition

HedgerRewardState


πŸ’° Position Management

Open a Position

Validations

  1. Hedger doesn't already have an active position

  2. positionSize > 0 and margin > 0

  3. leverage <= maxLeverage

  4. Sufficient margin ratio: margin Γ— leverage >= positionSize Γ— minMarginRatio

Flow

Close a Position

Validations

  1. Active position exists

  2. filledVolume == 0 (no more backed QEURO)

  3. Position "safe to close" (no debt to users)

Flow

Add Margin

Allows the hedger to improve margin ratio without closing the position.

Remove Margin

Condition: Margin ratio must remain above minMarginRatio after withdrawal.


πŸ“Š P&L Calculation

Unrealized P&L

EUR/USD Movement
Hedger Impact

EUR ↑ vs USD

Negative P&L

EUR ↓ vs USD

Positive P&L

Realized P&L

P&L is realized during QEURO redemptions:

Redemption Flow

Formula


πŸ”„ Vault Synchronization

The HedgerPool is synchronized with Vault mint/redeem operations.

During a Mint

Actions

  1. Increases filledVolume of active position

  2. Updates entryPrice (weighted average)

  3. Increases qeuroBacked

During a Redeem

Actions

  1. Decreases filledVolume proportionally

  2. Realizes P&L on closed portion

  3. Decreases qeuroBacked

During a Liquidation

Similar to standard redeem, but may apply special conditions.


πŸ’Έ Reward Distribution

Hedger Revenue Sources

  1. YieldShift Allocation: Share of Aave yield (10-50% depending on ratios)

  2. EUR/USD Rate Differential: Compensation for FX risk

  3. Position Fees: Entry/exit fees if configured

Claim Rewards

Constraints


βš™οΈ Configurable Parameters

CoreParams

Defaults

Parameter
Default Value
Description

minMarginRatio

1000 (10%)

Minimum margin/position ratio

maxLeverage

10

Max 10x leverage

entryFee

0

No entry fee

exitFee

0

No exit fee

Configuration Functions


πŸ›‘οΈ Security & Emergency Controls

Health Checks

Emergency Close

Allows the emergency team to close a position if:

  • Hedger is non-responsive

  • Position becomes dangerous for the protocol

  • A vulnerability is detected

Pause

Recovery

Recovers tokens sent by mistake (cannot recover active USDC).


πŸ“ Constants & Limits


πŸ“Š View Functions

Collateral Metrics

Position Data


πŸ”— YieldShift Integration

The HedgerPool integrates with YieldShift for yield distribution:

Distribution Flow


πŸ“‹ Events


⚠️ Custom Errors


Summary: The HedgerPool is the core of Quantillon's hedging mechanics. In the MVP, a single hedger provides EUR/USD coverage, earning revenue via YieldShift and rate differentials. The real-time P&L system and security controls ensure protocol stability.

Last updated