Documentation Index
Fetch the complete documentation index at: https://mintlify.com/reserve-protocol/reserve-index-dtf/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Folio contract is the heart of the Reserve Folio protocol. It’s a backed ERC20 token that allows permissionless minting and redemption while maintaining a flexible basket of underlying assets. The contract supports semi-permissioned rebalancing through a sophisticated auction mechanism.Key Features
- Flexible Basket: Supports multiple ERC20 tokens of any denomination
- Permissionless Mint/Redeem: Anyone can mint or redeem shares proportionally
- Dutch Auction Rebalancing: Uses exponential decay curves for efficient price discovery
- Fee System: TVL fees and mint fees with DAO revenue sharing
- Role-Based Access: Three main roles for governance and operations
Architecture
Folio implements:- ERC20Upgradeable (share token)
- AccessControlEnumerableUpgradeable (role management)
- ReentrancyGuardUpgradeable (security)
Roles
The Folio contract operates with three primary roles:Can set assets, fees, auction parameters, and deprecate the Folio
Can start/end rebalances and manage individual auctions (typically a timelock)
Can open auctions and end rebalances/auctions (typically an EOA or multisig)
Optional role for off-chain use with no on-chain permissions
Minting and Redeeming
Mint
Mint new Folio shares by depositing the basket of tokens proportionally.Amount of shares to mint (before fees)
Address to receive the minted shares
Minimum shares to receive after fees (slippage protection)
Folio.sol
Minting incurs fees: (1) DAO fee shares, (2) fee recipient shares, (3) self-fee shares that are burned.
Redeem
Burn Folio shares to receive the underlying basket proportionally.Amount of shares to burn
Address to receive the underlying tokens
Array of asset addresses (must match basket)
Minimum amounts of each asset to receive
Folio.sol
Rebalancing
Start Rebalance
Initiate a new rebalancing operation with target basket weights and prices.Rebalance parameters for each token including weights and price ranges
Target basket unit (BU) limits: low, spot, and high
Time (in seconds) that AUCTION_LAUNCHER has exclusive access
Total time-to-live for the entire rebalance
Folio.sol
Open Auction (Restricted)
AUCTION_LAUNCHER opens an auction with specific parameters.Nonce of the target rebalance
Subset of rebalance tokens to include in this auction
New basket weight ranges (can be progressively tightened)
New price ranges (subject to PriceControl setting)
New BU limits (must be within existing range)
Desired auction length in seconds
Folio.sol
Bidding
Participate in an ongoing auction by swapping tokens.ID of the auction to bid on
Token being sold by the Folio
Token being bought by the Folio
Amount of sell token to receive
Maximum amount of buy token willing to pay
If true, uses callback pattern (caller must implement IBidderCallee)
Arbitrary data passed to callback
Folio.sol
Fee Management
Set TVL Fee
Set the annual TVL fee (demurrage fee on AUM).New annual fee as D18 (e.g., 0.1e18 = 10%)
Folio.sol
Set Mint Fee
Set the fee charged on minting operations.New mint fee as D18 (e.g., 0.01e18 = 1%)
Folio.sol
Distribute Fees
Distribute accumulated fees to DAO and fee recipients.Folio.sol
Fees accumulate as “pending shares” and are distributed proportionally based on the configured fee recipients and DAO split.
View Functions
Total Assets
Get all assets and amounts held by the Folio.Folio.sol
To Assets
Convert shares to underlying asset amounts.Number of shares to convert
Rounding direction (Floor or Ceil)
Folio.sol
Get Rebalance
Get current rebalance state.Folio.sol
Events
Emitted when a new auction is openedParameters:
rebalanceNonce- Rebalance nonceauctionId- New auction IDtokens- Tokens in auctionweights- Weight rangesprices- Price rangeslimits- BU limitsstartTime- Auction start timestampendTime- Auction end timestamp
Emitted when a bid is placedParameters:
auctionId- Auction IDsellToken- Token soldbuyToken- Token boughtsellAmount- Amount soldbuyAmount- Amount bought
Emitted when rebalancing beginsParameters:
nonce- Rebalance noncepriceControl- Price control settingtokens- Token parameterslimits- BU limitsstartedAt- Start timestamprestrictedUntil- Restricted period endavailableUntil- Total expirationbidsEnabled- Whether bids are enabled
Emitted when fees are distributedParameters:
recipient- Fee recipient addressamount- Shares distributed
Constants
18-decimal fixed point scaling factor
27-decimal fixed point scaling factor (for high precision)
Maximum mint fee: 5%
Maximum annual TVL fee: 10%
Auction warmup period in seconds