Overview
Basket weights define how tokens are proportioned within a Folio. During rebalancing, weight ranges allow the AUCTION_LAUNCHER to progressively adjust token ratios within bounds set by governance.
Basket Unit (BU)
A Basket Unit (BU) is a theoretical unit of account representing a standardized bundle of the underlying tokens:
Typical usage: BUs are defined 1:1 with shares (1e18), but the protocol supports ranges up to 1e27.
Calculating Total Baskets
For a Folio with total supply of shares:
Weight Ranges
Weights define how many token quanta comprise one basket unit.
Example: 60/40 Portfolio
Weight Control
The weightControl flag in RebalanceControl determines whether the AUCTION_LAUNCHER can adjust weights:
Without Weight Control
AUCTION_LAUNCHER must use the exact spot weights from REBALANCE_MANAGER
- All auction weight ranges collapse to the spot value
- Suitable for Folios with fixed monthly/quarterly targets
With Weight Control
AUCTION_LAUNCHER can progressively narrow weight ranges
- Cannot expand beyond initial
low and high bounds
- Suitable for Folios maintaining specific percentage breakdowns over time
Surplus and Deficit Calculations
During auctions, tokens are classified as surplus or deficit based on current balances vs. target ranges:
Surplus
A token is in surplus when the Folio holds more than needed at the high limit:
Deficit
A token is in deficit when the Folio holds less than needed at the low limit:
Auction Pair Eligibility
A token pair is eligible for auction only if:
- Sell token is in surplus (using
high limit)
- Buy token is in deficit (using
low limit)
Lot Sizing
Auction sell amounts are calculated as the minimum of:
- Surplus constraint: How much sell token is surplus
- Deficit constraint: How much buy token is needed (converted via price)
- Max auction size: Governance-set maximum per token
Progressive Rebalancing
The AUCTION_LAUNCHER can run multiple auctions, progressively tightening both limits and weights:
Weights can only be narrowed, never expanded. Attempting to widen ranges beyond the initial low/high values will revert.
Dynamic vs Static Rebalancing
Static Targets (weightControl = false)
Use when:
- Rebalancing to a specific token composition (e.g., “own 1000 WETH and 1M USDC”)
- Target composition is known ahead of time
- Rebalances are infrequent (monthly, quarterly)
Dynamic Targets (weightControl = true)
Use when:
- Maintaining a percentage-based portfolio (e.g., “always 60/40 WETH/USDC”)
- Token ratios must adapt as prices change
- Rebalances are frequent or continuous
Units and Precision
Weight Units
- Format:
D27{tok/BU} (27 decimal fixed point)
- Range:
[0, 1e54]
- Calculation:
1e27 = 1 token quantum per BU
Example with Different Decimals
Handling Zero Weights
Zero weights are used to remove tokens from the basket:
Common Patterns
Equal-Weighted Portfolio
Capped Exposure
Validation Rules
Gas Optimization
Weight calculations happen on every getBid() call. To optimize:
- Use collapsed ranges (
low == spot == high) for final auctions
- Limit the number of tokens in rebalance (affects calculation loops)
- Consider
maxAuctionSize caps to prevent excessive lot sizing calculations