LogoLogo
Summer.fiContact us
  • Summer.fi
    • Overview
    • Basic Concepts
    • Audits
  • Lazy Summer Protocol
    • Lazy Summer Protocol
      • ARKs
        • Buffer ARK
        • RAFT
          • Dutch Auctions
      • Fees
      • Contracts Addresses
    • Rebalancer
    • Governance
      • Cross-Chain Governance
      • Rewards
      • Tip Streams
      • $SUMR Token
        • Delegation
        • Voting Power Decay
  • Summer.fi pro
    • General
      • Smart Contracts and Documentation
      • Costs and Fees
      • Address Compliance Check
      • Security
      • Referrals Program
        • FAQ
        • How to refer a friend
    • Products
      • Borrow
        • Frequently Asked Questions
      • Multiply
        • The difference between Borrow and Multiply Vaults
        • Frequently Asked Questions
      • Swap and Bridge
      • Earn
        • Aave v2 stETH
        • Aave v3 stETH
        • Dai Savings Rate (DSR)
          • sDAI
          • What is sDAI Conversion?
      • $RAYS
        • FAQ
    • Automation
      • Stop-Loss
        • How to setup your Stop-Loss
        • Trailing Stop-Loss
      • Auto-Buy
      • Auto-Sell
      • Take Profit
        • Auto Take Profit
          • How to setup Auto Take Profit
  • LEGAL
    • UK Disclaimer
    • Risks of using our products
  • Get in touch
    • Contact Us
Powered by GitBook
LogoLogo

Products

  • Borrow
  • Multiply
  • Earn

About

  • Team
  • Security
  • Terms
  • Privacy

Resources

  • Blog
  • Bug Bounty
  • Brand Assets

Oazo Apps 2023

On this page

Was this helpful?

Export as PDF
  1. Lazy Summer Protocol
  2. Governance

Tip Streams

Tip streams are a mechanism designed to distribute fees among specific entities within a vault. These entities share a portion of the fees based on predefined rules. This process involves minting additional shares as tips, which slightly dilutes the overall value of existing shares. To keep the system fair and sustainable, the yield generated by the vault must outpace the fees distributed. For context, we charge a fee of 1% of the Assets Under Management (AUM), which forms the basis of the tips distributed.

How Tip Streams Work

In any vault, the fee is set at the vault level rather than individually for entities. Tip streams define how this fee is divided among those entitled to a share of the tips. A key part of the process is setting the tip rate, which determines the proportion of the fee that will be distributed as tips. These tips are collected in a central pool known as the TipJar.

When tips are distributed, they are not taken directly from the vault’s assets. Instead, additional shares are minted to represent the tips. These newly minted shares are added to the TipJar. This increases the total number of shares in the vault, slightly reducing the value of each share since the same amount of assets is now split among a larger number of shares.

The 1% AUM fee ensures a steady and predictable source for tip distribution. This percentage is applied to the total assets managed by the vault, making the system straightforward and easy to calculate.

Note: The Ethereum Mainnet $ETH vault charges a 0.3% AUM fees, instead of the 1% for stablecoin vaults.

TipStream Management Functions

addTipStream(TipStream memory tipStream)

function addTipStream(TipStream memory tipStream) external onlyGovernor returns (uint256 lockedUntilEpoch) {
    if (tipStream.recipient == address(0)) {
        revert InvalidTipStreamRecipient();
    }
    if (tipStreams[tipStream.recipient].recipient != address(0)) {
        revert TipStreamAlreadyExists(tipStream.recipient);
    }
    if (tipStream.lockedUntilEpoch > block.timestamp + MAX_ALLOWED_LOCKED_UNTIL_EPOCH) {
        revert TipStreamLockedForTooLong(tipStream.recipient);
    }
    _validateTipStreamAllocation(tipStream.allocation, toPercentage(0));

    tipStreams[tipStream.recipient] = tipStream;
    tipStreamRecipients.push(tipStream.recipient);

    emit TipStreamAdded(tipStream);

    return tipStream.lockedUntilEpoch;
}

Distribution Functions

shake(address fleetCommander)

function _shake(address fleetCommander_) internal {
    if (!IHarborCommand(harborCommand()).activeFleetCommanders(fleetCommander_)) {
        revert InvalidFleetCommanderAddress();
    }

    IFleetCommander fleetCommander = IFleetCommander(fleetCommander_);
    uint256 shares = fleetCommander.balanceOf(address(this));
    
    if (shares == 0) return;

    uint256 withdrawnAssets = fleetCommander.redeem(
        Constants.MAX_UINT256,
        address(this),
        address(this)
    );

    if (withdrawnAssets == 0) return;

    IERC20 underlyingAsset = IERC20(fleetCommander.asset());
    uint256 totalDistributed = 0;
    Percentage totalAllocated = toPercentage(0);

    for (uint256 i = 0; i < tipStreamRecipients.length; i++) {
        address recipient = tipStreamRecipients[i];
        Percentage allocation = tipStreams[recipient].allocation;
        totalAllocated = totalAllocated + allocation;

        uint256 amount = (totalAllocated == PERCENTAGE_100) ? 
            withdrawnAssets - totalDistributed :
            withdrawnAssets.applyPercentage(allocation);

        if (amount > 0) {
            underlyingAsset.safeTransfer(recipient, amount);
            totalDistributed += amount;
        }
    }

    uint256 remaining = withdrawnAssets - totalDistributed;
    if (remaining > 0) {
        underlyingAsset.safeTransfer(treasury(), remaining);
    }
}

Query Functions

getTotalAllocation()

function getTotalAllocation() public view returns (Percentage total) {
    total = toPercentage(0);
    for (uint256 i = 0; i < tipStreamRecipients.length; i++) {
        total = total + tipStreams[tipStreamRecipients[i]].allocation;
    }
}

The contract uses the OpenZeppelin SafeERC20 library for safe token transfers and includes comprehensive error handling for invalid operations.

PreviousRewardsNext$SUMR Token

Last updated 2 months ago

Was this helpful?