YieldShift

YieldShift: Dynamic Yield Distribution System

πŸ“‹ Overview

YieldShift is the dynamic yield distribution engine in the Quantillon protocol. It automatically balances revenue distribution between users (stQEURO holders) and hedgers, based on market conditions and pool ratios.


πŸ—οΈ Contract Architecture

Inheritance

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

External Dependencies

Contract
Variable
Role

IERC20

usdc

Yield token

IUserPool

userPool

User pool metrics

IHedgerPool

hedgerPool

Hedger pool metrics

IAaveVault

aaveVault

Aave yield source

IstQEURO

stQEURO

User yield distribution

TimeProvider

TIME_PROVIDER

Centralized time management


πŸ” Roles & Permissions

Role
Responsibilities

GOVERNANCE_ROLE

Yield shift parameters

YIELD_MANAGER_ROLE

Yield distribution, operations

EMERGENCY_ROLE

Pause, emergencies


βš™οΈ Yield Shift Parameters

Main Parameters

Parameter
Type
Description
Default Value

baseYieldShift

uint256

Base allocation to users (BPS)

5000 (50%)

maxYieldShift

uint256

Max allocation to users (BPS)

9000 (90%)

adjustmentSpeed

uint256

Adjustment speed (BPS)

100 (1%)

targetPoolRatio

uint256

Optimal user/hedger ratio (BPS)

10000 (100%)

Interpretation

Time Constants


πŸ“Š Distribution Mechanism

Current Yield Shift Calculation

Distribution Formula

Pool State
currentYieldShift
Users Receive
Hedgers Receive

Balanced

50% (5000)

50%

50%

User Surplus

30% (3000)

30%

70%

Hedger Surplus

80% (8000)

80%

20%


πŸ• TWAP System (Time-Weighted Average Price)

TWAP smooths pool metrics over 24 hours to prevent manipulation.

Pool Snapshot

Snapshot History

TWAP Calculation


πŸ›‘οΈ Flash Deposit Protection

Holding Period (7 days)

The protocol excludes recent deposits from yield calculations to prevent attacks.

Eligible Pool Metrics

This function returns only "eligible" pool sizes - deposits that have passed the holding period.

Why This Matters


πŸ“‘ Authorized Yield Sources

Authorization System

Authorized Sources

Source
Type
Description

AaveVault

AAVE_YIELD

Yield from USDC lending on Aave

QuantillonVault

PROTOCOL_FEES

Mint/redeem fees

HedgerPool

HEDGING_FEES

Hedger operation fees

Source Management

Source Tracking

Allows tracking yield origin:


πŸ’° State Variables

Yield Pools

Pending Yield Per User


πŸ”„ Distribution Flow


πŸ“Š View Functions

Yield Shift Status

Pool Metrics

Yield Statistics

Historical Data


βš™οΈ Configuration

Update Parameters

Validations

  • baseYieldShift <= 10000 (max 100%)

  • maxYieldShift >= baseYieldShift

  • maxYieldShift <= 10000

  • targetPoolRatio > 0


πŸ›‘οΈ Security & Emergency Controls

Pause

Recovery


πŸ“‹ Events


πŸ“ Calculation Examples

Example 1: Standard Distribution

Example 2: User Imbalance

Example 3: Hedger Imbalance


Summary: YieldShift is the nervous system of yield distribution in Quantillon. It dynamically balances incentives between users and hedgers via a TWAP algorithm protected against manipulation, while ensuring that only deposits that have passed the 7-day holding period participate in distribution.

Last updated