PoolTogether 3.0
HomeAppBuilder
v3.4.0
v3.4.0
  • ✨Introduction
  • Resources
    • 📡Contracts
      • Ethereum
      • Celo
      • Matic
      • Tokens
    • đŸ•šī¸ Apps
    • 📈Subgraphs
  • Protocol
    • 🌐Overview
    • 🏆Prize Pools
      • âš–ī¸ Fairness
      • đŸĨŠStake Prize Pool
      • 📈Yield Source Prize Pool
    • 💸Prize Strategies
      • 🤑Multiple Winners
    • 👨‍🌾 Yield Sources
    • đŸŽŸī¸ Tokens
      • đŸŽŸī¸ Ticket
      • 🎁Sponsorship
    • 🎲Random Number Generator
      • Blockhash
      • Chainlink VRF
    • đŸ´â€â˜ ī¸ Loot Box
    • 🐋Pods
    • 🖖Prize Splits
    • 🛑Blocklist
  • Governance
    • đŸ›ī¸ Overview
    • đŸ•šī¸ Controls
    • đŸ—ŗī¸ Example Proposals
  • Contributing
    • 📐Smart Contract Guidelines
  • Security
    • Risks
    • Audits & Testing
    • Bounties
Powered by GitBook
On this page

Was this helpful?

  1. Protocol

👨‍🌾 Yield Sources

Yield sources generate yield for prize pools.

PreviousMultiple WinnersNextđŸŽŸī¸ Tokens

Last updated 4 years ago

Was this helpful?

A Yield Source contract is used by a Yield Source Prize Pool to generate yield for prizes.

The yield source just needs these properties:

  • The deposit asset is the same as the asset that accrues. I.e. if users deposit Dai into the yield source, then it should yield Dai as well

  • Yield must always be increasing. The mechanics of the Prize Pool require yield to always go up, as it's a no-loss system. The yield source must protect depositor's collateral.

There are implementations for all of the major yield sources:

  • Compound

  • Aave

  • Yearn

  • More!

See the full list

Yield Source Interface

The yield source interface is very simple; it just needs to support four functions:

/// @title Defines the functions used to interact with a yield source.  The Prize Pool inherits this contract.
/// @notice Prize Pools subclasses need to implement this interface so that yield can be generated.
interface IYieldSource {

  /// @notice Returns the ERC20 asset token used for deposits.
  /// @return The ERC20 asset token
  function depositToken() external view returns (address);

  /// @notice Returns the total balance (in asset tokens).  This includes the deposits and interest.
  /// @return The underlying balance of asset tokens
  function balanceOfToken(address addr) external returns (uint256);

  /// @notice Supplies tokens to the yield source.  Allows assets to be supplied on other user's behalf using the `to` param.
  /// @param amount The amount of `token()` to be supplied
  /// @param to The user whose balance will receive the tokens
  function supplyTokenTo(uint256 amount, address to) external;

  /// @notice Redeems tokens from the yield source.
  /// @param amount The amount of `token()` to withdraw.  Denominated in `token()` as above.
  /// @return The actual amount of tokens that were redeemed.
  function redeemToken(uint256 amount) external returns (uint256);

}

See the Specification on Github
here