Skip to main content

Overview

Reserve Folio defines several interfaces that enable contract interaction, custom integrations, and extensibility. Understanding these interfaces is crucial for building on the protocol.

IFolio

Core interface for Folio contracts.

Key Enums

PriceControl

Defines how much control AUCTION_LAUNCHER has over pricing.
ATOMIC_SWAP enables instant rebalancing at fixed prices without a Dutch auction curve.

Key Structs

FolioBasicDetails

Basic configuration for creating a Folio.
string
Name of the Folio token
string
Symbol of the Folio token
address[]
Initial basket token addresses
uint256[]
Initial deposit amounts for each token
uint256
Number of shares to mint initially

RebalanceLimits

Basket Unit (BU) limits for rebalancing operations.
uint256
Lower BU limit - buy assets up to this level (D18 format)
uint256
Point estimate for unrestricted callers (D18 format)
uint256
Upper BU limit - sell assets down to this level (D18 format)
Must satisfy: 0 < low <= spot <= high <= MAX_LIMIT

WeightRange

Token weight range for basket definition.
uint256
Minimum weight - buy up to this (D27 format: tok/BU)
uint256
Point estimate weight (D27 format)
uint256
Maximum weight - sell down to this (D27 format)

PriceRange

Price range for a token in the Unit of Account (UoA).
uint256
Lower price bound (D27 format: UoA/tok)
uint256
Upper price bound (D27 format: UoA/tok)
Must satisfy: 0 < low < high <= MAX_TOKEN_PRICE and high <= MAX_TOKEN_PRICE_RANGE * low

TokenRebalanceParams

Complete parameters for a token in rebalancing.
address
Token address
WeightRange
Weight range for this token
PriceRange
Price range for this token
uint256
Maximum amount that can be traded in a single auction
bool
Whether this token is part of the rebalance

FeeRecipient

Defines a fee recipient and their share.
address
Address to receive fees
uint96
Share of fees (D18 format, must sum to 1e18 across all recipients)
Fee recipients must be sorted by address in ascending order with no duplicates.

Key Function

Distribute accumulated fees to DAO and fee recipients. Called automatically before fee configuration changes.

IBidderCallee

Interface for contracts that want to participate in auctions using callbacks.
address
Token that needs to be transferred to the Folio
uint256
Amount of buy token to transfer
bytes
Arbitrary data passed from bid() call
Callback Pattern: Allows bidders to receive sell tokens before paying, useful for flash loan integrations or atomic arbitrage.

Callback Flow

  1. User calls folio.bid() with withCallback = true
  2. Folio transfers sell tokens to bidder
  3. Folio calls bidder.bidCallback()
  4. Bidder must transfer buy tokens to Folio before callback returns
  5. Folio verifies payment and completes bid

IGovernanceDeployer

Interface for deploying governance systems.

GovParams Struct

uint48
Delay before voting starts (seconds)
uint32
Duration of voting period (seconds)
uint256
Minimum voting power to create proposals (D18)
uint256
Minimum voting power for quorum (D18)
uint256
Delay before executing approved proposals (seconds)
address[]
Addresses with proposal cancellation powers

IFolioDAOFeeRegistry

Interface for querying DAO fee configuration.
Fee calculation: daoFee = max(totalFee * feeNumerator / feeDenominator, feeFloor)

IFolioVersionRegistry

Interface for version management.

IFolioDeployer

Interface for Folio factory contracts.

IRoleRegistry

Interface for protocol-wide role management.

Usage Examples

Implementing a Bidder with Callback

Checking Version Before Deployment

Interface Files

All interfaces are located in /contracts/interfaces/:
  • IFolio.sol - Core Folio interface
  • IBidderCallee.sol - Bidder callback interface
  • IGovernanceDeployer.sol - Governance deployment
  • IFolioDAOFeeRegistry.sol - DAO fee configuration
  • IFolioVersionRegistry.sol - Version management
  • IFolioDeployer.sol - Folio factory
  • IRoleRegistry.sol - Role management