Skip to main content

YieldDonatingTokenizedStrategy

Git Source

Inherits: TokenizedStrategy

Author: Golem Foundation

Specialized TokenizedStrategy for productive assets with discrete harvesting; profits are donated by minting shares to the dragon router.

*Behavior overview:

  • On report(), harvests the underlying position via BaseStrategy.harvestAndReport()
  • If newTotalAssets > oldTotalAssets, mints shares equal to the profit (asset value) to the dragon router
  • If losses occur and burning is enabled, burns dragon router shares (up to its balance) using rounding-up shares-to-burn
  • No tracked-loss bucket exists; any loss not covered by dragon router burning reduces totalAssets and affects PPS for all holders Economic notes:
  • Profit donations are realized via share mints at the time of report
  • Losses first attempt dragon share burning when enabled; residual losses decrease PPS
  • Dragon router change follows TokenizedStrategy cooldown and two-step finalization*

Note: security-contact: [email protected]

Functions

report

Reports strategy performance and distributes profits as donations

Mints profit-derived shares to dragon router when newTotalAssets > oldTotalAssets; on loss, attempts dragon share burning if enabled. Residual loss reduces PPS (no tracked-loss bucket).

function report()
public
virtual
override(TokenizedStrategy)
nonReentrant
onlyKeepers
returns (uint256 profit, uint256 loss);

_handleDragonLossProtection

Internal function to handle loss protection for dragon principal

function _handleDragonLossProtection(StrategyData storage S, uint256 loss) internal;

Parameters

NameTypeDescription
SStrategyDataStorage struct pointer to access strategy's storage variables
lossuint256Amount of loss to protect against in asset base units If burning is enabled, this function will try to burn shares from the dragon router equivalent to the loss amount.

Events

DonationMinted

Emitted when profit shares are minted to dragon router

event DonationMinted(address indexed dragonRouter, uint256 amount);

Parameters

NameTypeDescription
dragonRouteraddressAddress receiving minted donation shares
amountuint256Amount of shares minted in share base units

DonationBurned

Emitted when dragon shares are burned to cover losses

event DonationBurned(address indexed dragonRouter, uint256 amount);

Parameters

NameTypeDescription
dragonRouteraddressAddress whose shares are burned
amountuint256Amount of shares burned in share base units