Treasury

Table of Contents

Summary

This module is a custom creation made of two smart contracts: The first one, the Kolektivo Treasury, holds the natural capital assets (or their indexes) and creates the Kolektivo Treasury Token (KTT) which directly represents the treasury’s value. KTT is a rebase token, influenced by Ampleforth. Through its elastic supply and the rebasing mechanics, the aim is to keep the token value close to a certain ratio. The treasury is comprised of the various LP index tokens as well as other currencies.

Module Details

The Treasury Module has 2 core components consisting of the Treasury.sol, and ElasticReceiptToken.sol contracts.

Treasury

The Treasury.sol contract allows to:

  • Hold multiple tokens: ERC20, Index/Liquidity Tokens from Balancer, Stable Coins such as cUSD or cEUR, ERC721, and GeoNFTs.

  • Withdraw certain tokens up to a certain amount (limited to certain addresses and revokable). For example: A mapping of address => address => uint256, where we can define “Address X can withdraw Token Y up to a limit of 123”.

  • Send treasury assets to arbitrary addresses. For example, the Treasury has stables and wants to fund a Kolektivo community economy.

  • Sell and buy assets (bond and redeem) by minting/burning the Kolektivo Treasury Token (KTT). This implies that the treasury allows to:

    • List certain tokens as bondable/redeemable

    • List certain tokens to be unbonded/unredeemed

    • Dynamically set the price of the bonds based on the value of assets to un-/bond. Note that the pricing should depend on the average value for some time to prevent flash loan attacks.

  • Perform negative and positive rebases

  • Modify the rebase impact by applying a damping factor to the supply delta (e.g. 1/5)

What are supply delta and dampening factor?

The supply delta is the input of the rebasing function (i.e. by how much the rebase should be). A dampening factor decreases the supply delta parameter to stretch the rebasing out over multiple epoches (soft) vs. doing it at once (hard).

  • Create an elastic supply token (KTT).

  • Modify the deviation threshold defining supply boundaries in which no rebase should occur (e.g. 5%)

Error Messages

Code
Description

Treasury__ERC20IsNotBondable(address erc20)

Function is only callable for bondable erc20's

Treasury__ERC721IdIsNotBondable(address erc721, uint id)

Function is only callable for bondable erc721Id's

Treasury__ERC20IsNotRedeemable(address erc20)

Function is only callable for redeemable erc20's

Treasury__ERC721IdIsNotRedeemable(address erc721, uint id)

Function is only callable for redeemable erc721Id's

Treasury__ERC20IsNotRegistered(address erc20)

Function is only callable for registered erc20's

Treasury__ERC721IdIsNotRegistered(address erc721, uint id)

Function is only callable for registered erc721Id's

Treasury__StaleERC20PriceDeliveredByOracle(address erc20, address oracle)

Functionality is limited due to stale price delivered by oracle

Treasury__StaleERC721IdPriceDeliveredByOracle(address erc721, uint id, address oracle)

Functionality is limited due to stale price delivered by oracle

Treasury Token

The Treasury Token is a vanilla ERC-20 token backed by the Treasury's assets. It is called the Kolektivo Treasury Token (KTT), and it is an elastic / rebasing token, which means that 1 KTT is always worth 1$ worth of treasury assets. The KTT contract is inspired by the well-tested Ampleforth. Here are some of the token's characteristics:

  • The maximum supply is one billion.

  • Each rebase happens at an epoch.

  • Each time someone interacts with a token, e.g. token transfer, rebase is triggered a rebase.

  • Rebase can also be called manually.

Error Messages

Code
Description

InvalidRecipient

Invalid token recipient

InvalidAmount

Invalid token amount

MaxSupplyReached

Maximum supply reached

Failure Modes

Last updated

Was this helpful?