Fees And Reserves
Fee generation is a core element of the Sommelier Cellars incentive model: when Cellars earn returns, fees can be disbursed to both the strategist and the network. Incentivizing strategists encourages the continued development of new and effective strategies for users, and incentivizing the network contributes to the security of the Sommelier Chain.
strategistPlatformCut- the percentage of fees that will go to the strategist, with 16 units of precision (
1e18 == 100%).
platformFee- the percentage of total assets that will be assessed as fees, with 16 units of precision. This value is currently deprecated, and has been replaced by FeesAndReserves (see "FeesAndReserves Functionality" below).
lastAccrual- the time fees were last accrued, for accounting purposes (see "Fee Accounting Mechanisms"). This value is currently deprecated, and has been replaced by FeesAndReserves (see "FeesAndReserves Functionality").
strategistPayoutAddress- the address that will receive the strategist portion of earned fees.
strategistPayoutAddressfor a given Cellar can be updated by Sommelier Governance.
While the Cellar itself stores fee configuration in
FeeData, and exposes getters and setters for that configuration, the Cellar itself contains no logic for the assessment or disbursal of fees. In order for the strategist and platform to account for, accrue, and disburse fees, a Cellar must use a
FeesAndReservescontract with a
The FeesAndReserves contract contains logic which reads Cellar fee configuration and is subsequently able to accrue and set aside fees for withdrawal. The FeesAndReserves contract contains specific accounting configuration for each Cellar in the MetaData struct.
Using FeesAndReserves, Cellars can assess two types of fees:
- Management Fees are flat-rate, annualized fees on total Cellar TVL. The
MetaDatastruct contains a
managementFeefield, expressed in basis points.
- Performance Fees are earned any time a Cellar generates profit past its high-watermark (specified by
MetaDatastruct contains a
performanceFeefield, also expressed in basis points.
Management and performance fees can be changed by the strategist using the
updateManagementFeefunctions. When fees are changed, they only take effect after the next fee accrual.
When fees accrue and are prepared for distribution to the platform, they cannot come from currently-allocated positions. Instead, any future fees must be "reserved" by the strategist in the FeesAndReserves contract.
Strategists can reserve assets for fee disbursement by calling the function
FeesAndReservesAdaptor, further described below). When assets are added to reserves, they are held by the
FeesAndReservescontract and continue to contribute to Cellar TVL, but can not be deployed in positions. Strategists can also withdraw assets from reserves using
withdrawAssetsFromReserves, meaning that those assets can no longer be used for the disbursal of fees.
It is optimal for the strategist to keep reserves funded equal to the level of eligible fees for disbursal. If too few assets are added to reserves, only the reserved amount can be withdrawn even if a larger amount of fees can be accounted for. The balance of fees can be later withdrawn after topping up reserves. Conversely, if too many assets are added to reserves, it will be a drag on the cellar's performance, reducing the fee-earning potential of the Cellar.
Note that reserves must be funded in a single, pre-specified asset only - this is the asset specified by
Fee accrual runs with a keeper-based architecture: accounting is performed and new fees are assessed only when triggered, reducing extra accounting overhead for user-facing Sommelier Cellar transactions.
External parties can call the
checkUpkeepfunction to determine if new fees have been earned, and if new accounting should take place to accrue these fees to the platform. Each cellar can define its own upkeep parameters that determine when fees should be accrued:
- Cellars should set
MetaDatato set a cooldown time between fee accrual calls.
- Cellars can set
MetaDatato make sure that fee accrual calls only happen when gas conditions are favorable. Since every position in a cellar must be read to accrue fees, the process can be gas-intensive for complex Cellars.
As long as cooldown periods and gas requirements allow it, for each Cellar, the accounting mechanism within
_calculateFeeswill perform the following steps to determine new eligible fees:
- 1.The cellar's total assets and total supply will be checked. These values will be divided to determine the exact pre-share price of the Cellar.
- 2.The cellar will then calculate the new management fee: this is assessed on the delta in
totalAssetsbetween the current calculation and the last accrual, and is prorated such that
managementFeeis an annualized value.
- 3.If the cellar's share price has surpassed the previous
exactHighWatermark, new performance fees will be calculated. This is assessed on the delta in
totalAssetsbetween the current calculation and the last accrual, multiplied by the difference between the current share price and the previous high watermark. The fee is prorated such that
performanceFeeis an annualized value.
checkUpkeepcompletes, the caller will receive a list of Cellars that are eligible for new fee accrual, and how many new fees an accrual operation will accrue. Note that
viewfunction and does not perform the accrual itself -
performUpkeepmust be called to update
MetaDatawith any new fee accrual values.
performUpkeepwill perform the same operations as
checkUpkeep, but create new storage entries that update the amount of fees owed based on the above calculations. The Chainlink automation registry can bypass repeated calculation and pass in the input of
checkUpkeepdirectly, encouraging established and approved Keepers to use this feature.
Once fees have been accrued and
MetaDataupdated with new owed fees, new share prices and TVL, and the latest accrual time, fees can be prepared for disbursement.
metaDatastruct for a given Cellar reflects new
feesOwed, those fees can be withdrawn from reserves and disbursed to the platform. To do so, the
prepareFeesfunction should be called. This function will:
feesOwedfor the amount being prepared.
reservesfor the amount being prepared. The reserves for the Cellar must contain this amount to prepare fees.
feesReadyForClaim, moving the assets out of Cellar
MetaDataaccounting and into the withdrawal holding pool.
Once fees are in the withdrawal holding pool, they can be sent out to the platform and strategist using the
feesReadyForClaimcan be disbursed, and only the entire balance of ready fees can be sent. When called,
sendFeeswill split earned fees into strategist and network portions, send strategist to the
strategistPayoutAddressdefined by the cellar. Platform fees will be sent to the Sommelier Chain via the Gravity Bridge.
Since disbursed fees are withdrawn from reserves, they are always delivered in the form of the
reserveAsset. Strategists may need to re-deposit to reserves after a disbursement in order to facilitate future fee accruals.
In certain scenarios, Governance may reduce the high-watermark of a given Cellar. In these scenarios, the high-watermark cannot be increased. The
resetPercentargument specifies in basis points what percentage of the delta between the cellar's current share price and the old high watermark should be removed from the new high-watermark. For instance, a
10000will remove the entirety of the specified delta and reset the new high watermark to the current share price.
When resetting the high watermark, any owed fees are removed. Therefore in certain cases strategists should make sure to call
prepareFeesbefore the high watermark is reset.
Like other adaptors (see "Building Adaptors" for more information), the FeesAndReservesAdaptor wraps the relevant methods from the FeesAndReserves contract. The FeesAndReserves logic itself does not belong to the adaptor, since reserves are stored in an external contract and not in the cellar itself. The FeesAndReservesAdaptor enables all strategist-triggered functionality as specified in the documentation above.
Sommelier Cellar builders who wish to apply fees should use an already-deployed FeesAndReserves contract, and must have the FeesAndReservesAdaptor approved for their cellar.
Last modified 21d ago