Skip to main content

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:
Ensure token decimals are handled correctly. The amounts array should reflect actual token quantum (e.g., USDC with 6 decimals uses 1e6 for 1 USDC).

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 prices
  • PARTIAL: Can narrow price ranges within bounds
  • ATOMIC_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:
Set the ETHERSCAN_API_KEY environment variable to your API key for the target network (Basescan, Etherscan, Arbiscan, etc.).

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 the REBALANCE_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

The AUCTION_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:
Important: All percentages and ratios use fixed-point arithmetic. A value of 1e18 represents 100% or 1:1 ratio, NOT 1e18%.

Security Best Practices

Always check stateChangeActive() returns false before relying on view function data:
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.
Set price ranges conservatively to account for:
  • Timelock delays
  • Block-to-block price volatility
  • MEV searcher exploitation
If prices move outside ranges, AUCTION_LAUNCHER must end the rebalance to prevent value leakage.
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

This occurs when depositing incorrect amounts during minting. Ensure:
  • All basket tokens are approved
  • Amounts match current basket ratios
  • Account for token decimals correctly
The restricted period has not ended. Either:
  • Wait for the restricted period to expire
  • Have the AUCTION_LAUNCHER open the auction
  • Have the REBALANCE_MANAGER end the rebalance
Mint fee changed between transaction submission and execution. Increase your slippage tolerance in the minSharesOut parameter.
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