IYieldSkimmingStrategy
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
| Name | Type | Description |
|---|---|---|
exchangeRate | uint256 | Current 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
| Name | Type | Description |
|---|---|---|
lastRateRay | uint256 | Last 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
| Name | Type | Description |
|---|---|---|
decimals | uint256 | Number 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
| Name | Type | Description |
|---|---|---|
currentRateRay | uint256 | Current 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
| Name | Type | Description |
|---|---|---|
userDebtInAssetValue | uint256 | Users’ 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
| Name | Type | Description |
|---|---|---|
dragonDebtInAssetValue | uint256 | Dragon router value debt |
getTotalValueDebtInAssetValue
Combined underlying-asset-value debt owed to users and dragon router
function getTotalValueDebtInAssetValue() external view returns (uint256 totalDebtInAssetValue);
Returns
| Name | Type | Description |
|---|---|---|
totalDebtInAssetValue | uint256 | Users + 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
| Name | Type | Description |
|---|---|---|
isInsolvent | bool | True 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
| Name | Type | Description |
|---|---|---|
profit | uint256 | Profit reported by the accounting sync |
loss | uint256 | Loss reported by the accounting sync |