Prerequisites
Before you begin, ensure you have the following:Development Tools
- Foundry (for Solidity development)
- Node.js v20+
- Yarn package manager
Knowledge Requirements
- Understanding of ERC20 tokens
- Basic Solidity knowledge
- Familiarity with Dutch auctions
Installation
1
Clone the Repository
2
Install Dependencies
3
Build the Project
4
Run Tests
Verify everything is working correctly:
Deploying Your First Folio
Step 1: Configure Folio Parameters
Define your Folio’s initial configuration:Step 2: Set Fee Configuration
TVL fees are specified as per-second rates. The example shows 100 bps annually:
100e18 / 365 days.Step 3: Configure Rebalance Control
Price Control Levels:
NONE: AUCTION_LAUNCHER cannot adjust pricesPARTIAL: Can narrow price ranges within boundsATOMIC_SWAP: Can execute instant swaps at fixed prices (highest trust required)
Step 4: Deploy the Folio
Step 5: Deploy via Command Line
For production deployment:Core Operations
Minting Folio Shares
Users can mint Folio shares by depositing the required basket of assets:Mint fees are automatically deducted. Specify
minSharesOut to protect against fee changes between transaction submission and execution.Redeeming Folio Shares
Redeem Folio shares to receive the underlying assets pro-rata:Starting a Rebalance
Only theREBALANCE_MANAGER can initiate rebalances:
Basket Units (BU):
A Basket Unit is typically defined 1:1 with shares (1e18 BU = 1e18 shares). The limits define the target range for rebalancing.
Opening an Auction
TheAUCTION_LAUNCHER can open auctions during the restricted period:
Bidding in an Auction
Anyone can bid in an active auction:Auctions use an exponential decay curve. Prices improve over time, starting at the most optimistic price and moving toward the most pessimistic price.
Checking Auction Status
Understanding Units
Folio uses a precise unit notation system:Security Best Practices
Read-Only Reentrancy Protection
Read-Only Reentrancy Protection
Always check
stateChangeActive() returns false before relying on view function data:Token Removal Considerations
Token Removal Considerations
If removing a token via
removeFromBasket(), users have limited time to redeem before the token becomes inaccessible. Only remove tokens that are malicious or compromised.Price Range Safety
Price Range Safety
Set price ranges conservatively to account for:
- Timelock delays
- Block-to-block price volatility
- MEV searcher exploitation
AUCTION_LAUNCHER must end the rebalance to prevent value leakage.Auction Launcher Trust
Auction Launcher Trust
With
PARTIAL or ATOMIC_SWAP price control, the AUCTION_LAUNCHER can cause value leakage. Choose trusted operators and consider using NONE for maximum security.Troubleshooting
Folio__InvalidAssetAmount Error
Folio__InvalidAssetAmount Error
This occurs when depositing incorrect amounts during minting. Ensure:
- All basket tokens are approved
- Amounts match current basket ratios
- Account for token decimals correctly
Folio__AuctionCannotBeOpenedWithoutRestriction
Folio__AuctionCannotBeOpenedWithoutRestriction
The restricted period has not ended. Either:
- Wait for the restricted period to expire
- Have the
AUCTION_LAUNCHERopen the auction - Have the
REBALANCE_MANAGERend the rebalance
Interactive Commands Not Working
Interactive Commands Not Working
Never use interactive git commands (like
git rebase -i or git add -i) as they require user input. Use non-interactive alternatives instead.Next Steps
System Architecture
Learn about the rebalancing mechanism, auction curves, and lot sizing
API Reference
Explore all available functions and their parameters
Additional Resources
GitHub Repository
View source code and examples
Release Notes
Track version history and updates
Trusted Fillers
Learn about CoW Swap integration