Skip to main content

IYieldSkimmingStrategy

Git Source

Title: IYieldSkimmingStrategy

Author: Golem Foundation

Interface for yield skimming strategies with value debt tracking

Exposes exchange rate and debt accounting for appreciating assets

Note: security-contact: [email protected]

Functions

getCurrentExchangeRate

Get the current exchange rate of the yield-bearing asset vs underlying

Returns the raw exchange rate as provided by the asset (native decimals)

function getCurrentExchangeRate() external view returns (uint256 exchangeRate);

Returns

NameTypeDescription
exchangeRateuint256Current exchange rate

getLastRateRay

Get the last reported exchange rate in RAY precision

Value is stored in the strategy and updated on report(); 27 decimals

function getLastRateRay() external view returns (uint256 lastRateRay);

Returns

NameTypeDescription
lastRateRayuint256Last rate in RAY

decimalsOfExchangeRate

Get the decimals used by the asset’s exchange rate

Used to scale to RAY (1e27) internally

function decimalsOfExchangeRate() external view returns (uint256 decimals);

Returns

NameTypeDescription
decimalsuint256Number of decimals in the external exchange rate

getCurrentRateRay

Get the current exchange rate scaled to RAY (1e27)

Convenience view for integrations that expect RAY precision

function getCurrentRateRay() external view returns (uint256 currentRateRay);

Returns

NameTypeDescription
currentRateRayuint256Current rate in RAY

gettotalDebtOwedToUserInAssetValue

Total underlying-asset-value debt owed to users (excludes dragon router)

Units: value-shares where 1 share = 1 unit of asset value

function gettotalDebtOwedToUserInAssetValue() external view returns (uint256 userDebtInAssetValue);

Returns

NameTypeDescription
userDebtInAssetValueuint256Users’ combined value debt

getDragonRouterDebtInAssetValue

Total underlying-asset-value debt owed to dragon router

Increases on profit mints, decreases on loss burns or debt rebalancing

function getDragonRouterDebtInAssetValue() external view returns (uint256 dragonDebtInAssetValue);

Returns

NameTypeDescription
dragonDebtInAssetValueuint256Dragon router value debt

getTotalValueDebtInAssetValue

Combined underlying-asset-value debt owed to users and dragon router

function getTotalValueDebtInAssetValue() external view returns (uint256 totalDebtInAssetValue);

Returns

NameTypeDescription
totalDebtInAssetValueuint256Users + dragon value debt

isVaultInsolvent

Check whether the vault is insolvent

Insolvent when total vault value (assets * rate) is below user debt. Dragon debt is excluded from this check because dragon shares are junior loss-buffer accounting and are expected to absorb losses before users.

function isVaultInsolvent() external view returns (bool isInsolvent);

Returns

NameTypeDescription
isInsolventboolTrue if vault cannot cover user value debt

reportAndDisableBurning

Reports current accounting, then disables dragon burn loss protection.

Use this when disabling burning may otherwise race with unreported loss.

function reportAndDisableBurning() external returns (uint256 profit, uint256 loss);

Returns

NameTypeDescription
profituint256Profit reported by the accounting sync
lossuint256Loss reported by the accounting sync