Skip to main content

Overview

Folio auctions use a Dutch auction mechanism where prices move from optimistic to pessimistic over time. All token pairs trade simultaneously, and bidders can participate by:
  1. Direct bidding - Swap tokens at the current auction price
  2. Callback bidding - Execute custom logic before transferring tokens
  3. Trusted fills - Use aggregators like CowSwap for complex routing
Auctions have a 30-second warmup period to ensure fair competition. This is skipped for atomic swaps where start price equals end price.

Understanding Auction Mechanics

Surplus and Deficit

Auctions only allow trading between:
  • Surplus tokens: Tokens above the high basket limit
  • Deficit tokens: Tokens below the low basket limit

Price Discovery

Prices follow an exponential decay curve:
  • Start: Most optimistic prices (favorable to Folio)
  • End: Most pessimistic prices (favorable to bidders)
  • Current: Interpolated based on time elapsed

Direct Bidding

The simplest way to participate in auctions.
1

Query Available Bids

Find profitable opportunities:
Compare the auction price against external markets (Uniswap, etc.) to identify arbitrage opportunities.
2

Approve Tokens

The Folio needs allowance to pull buy tokens from you:
3

Execute Bid

Submit your bid:
After the bid:
  • Your WETH balance increases by sellAmount
  • Your USDC balance decreases by actualBidAmount
  • actualBidAmount should be ≤ bidAmount (your max)
4

Arbitrage on External Markets

Immediately trade your received tokens for profit:

Callback Bidding

For advanced strategies, use callbacks to execute custom logic within the bid transaction.
1

Implement IBidderCallee Interface

Your contract must implement the callback interface:
2

Call Bid with Callback

Callback Flow:
  1. Folio transfers sellAmount of sell token to you
  2. Folio calls bidderCallback() on your contract
  3. Your callback executes and transfers buyAmount to Folio
  4. Folio verifies it received the tokens
Security Considerations:
  • Always validate msg.sender is the Folio in your callback
  • Set slippage limits to protect against sandwich attacks
  • Ensure callback execution is atomic (reverts return everything)

Trusted Filler Integration

Trusted fillers enable async execution using specialized solvers like CowSwap.
1

Create Trusted Fill

Instead of bidding directly, create a trusted fill order:
The Folio will automatically close and claim tokens from the trusted filler at the next state-changing call.
2

Execute Fill (Solver Side)

The trusted filler contract handles the actual swap:
3

Monitor Fill Status

Check if the async swap is still active:

Bidding Requirements

If bidsEnabled is true for the rebalance, anyone can bid on auctions.
Bids cannot be placed on deprecated Folios:
Bids are only valid during the auction’s active period:
  • After warmup period (30 seconds, or 0 for atomic swaps)
  • Before end time
You can only trade pairs where:
  • Sell token is in surplus (above high limit)
  • Buy token is in deficit (below low limit)
Not all tokens in an auction can be traded together at all times.

Advanced Strategies

Multi-Hop Arbitrage

Bid on multiple pairs in sequence:

Flash Loan Arbitrage

Use flash loans to amplify profits:

Monitoring Events

Listen to auction events for opportunities:

Code Reference

  • Bid execution: contracts/Folio.sol:794-813
  • Get bid parameters: contracts/Folio.sol:776-783
  • Trusted fill creation: contracts/Folio.sol:816-847
  • Bid callback interface: contracts/interfaces/IBidderCallee.sol

Next Steps

Managing Rebalances

Learn how to start and configure rebalances

Minting & Redeeming

Understand how to mint and redeem Folio shares