Yield Distribution

Automatic, Trustless, Fair

Chainlink Automation ensures yield distribution happens automatically at maturity—no manual claims required.


How It Works

1. Property Owner Deposits Yield

factory.depositYield(
  seriesId: 1, // uniq id for token series
  periodId: 1, // period number
  amount: 100000e18  // 100k USDC rental income
)

USDC transferred from owner to factory contract, ready for distribution.


2. Maturity Date Reached

When block.timestamp >= maturityDate:

Chainlink Automation triggers:

checkUpkeep() → returns (true, performData)

3. Snapshot Taken

performUpkeep(performData) {
  // Freeze all holder balances
  // Save snapshot holder list
  // Lock distribution amounts
}

Snapshot captures:

  • All token holder addresses

  • Each holder's balance

  • Total supply at that moment


4. Yield Distributed

distributeToAllHolders(seriesId, periodId) {
  for each snapshot holder:
    yield = (holderBalance / totalSupply) × totalYield
    transfer USDC to holder
}

USDC appears in wallets automatically!


Key Concepts

Snapshot System

Balances frozen at maturity prevent gaming:

Example:

Day 89: Alice holds 100 YRT
Day 90 (Maturity): Snapshot taken
Day 91: Alice sells all 100 YRT to Bob
Day 92: Distribution triggered

Result:
→ Alice receives yield (held at snapshot)
→ Bob receives nothing (bought after snapshot)

Multi-Period Independence

Each period has separate snapshot:

Q1 Snapshot: Alice 100, Bob 50, Owner 850
Q1 Distribution: Based on Q1 snapshot

Owner mints 500 tokens (expansion)

Q2 Snapshot: Alice 100, Bob 50, Charlie 500, Owner 850
Q2 Distribution: Based on Q2 snapshot

Q1 and Q2 completely independent!

Pro-Rata Distribution

Yield distributed proportionally:

Total Supply: 1000 YRT
Total Yield: 100,000 USDC

Alice: 250 YRT (25%) → 25,000 USDC
Bob: 200 YRT (20%) → 20,000 USDC
Charlie: 150 YRT (15%) → 15,000 USDC
Owner: 400 YRT (40%) → 40,000 USDC

Business Owner Control

Hybrid Role System

Business owners can trigger distribution for their own series:

// As series admin (auto-granted on series creation):
distributor.distributeToAllHolders(mySeriesId, periodId)

✅ No need to wait for platform admin

✅ Self-service distribution

✅ Isolated - cannot trigger other series


Safety Features

Cannot Claim Twice

hasClaimedYield[seriesId][periodId][holder] = true

Each holder can only receive yield once per period.

Must Have Snapshot

Distribution only possible after snapshot is taken.

Proportional Calculation

Math ensures fair distribution based on holdings.


Last updated