Revenue Model
The vault operates on a buy low, resell high model:- The off-chain
TimeBoostBiddersignals the vault to record a round win at cost X. - While the vault controls the express lane, buyers pay a configurable USDC resale price to purchase access.
- The difference between resale earnings and bid costs is the vault’s profit.
Storage Layout
Access Control
The vault has two privileged roles:| Role | Address | Powers |
|---|---|---|
| Owner | owner | Withdraw funds, set resale price, record wins |
| Bid Agent | bid_agent | Record round wins, end rounds |
record_round_win and end_round.
Only the owner can withdraw funds and update the resale price.
Public Methods
initialize(usdc, bid_agent, resale_price_usdc) -> Result<()>
initialize(usdc, bid_agent, resale_price_usdc) -> Result<()>
Set the owner, USDC token address, authorized bid agent, and initial resale
price. Can only be called once.
deposit_eth() -> Result<()>
deposit_eth() -> Result<()>
Deposit ETH into the vault for bidding capital. Payable method — send ETH
with the transaction.
- Emits
Deposited(from, amount, isEth: true).
deposit_usdc(amount) -> Result<()>
deposit_usdc(amount) -> Result<()>
Deposit USDC into the vault. Requires prior ERC-20 approval.
- Calls
transferFromon the USDC contract. - Emits
Deposited(from, amount, isEth: false).
record_round_win(round, bid_cost_wei) -> Result<()>
record_round_win(round, bid_cost_wei) -> Result<()>
Called by the bid agent when the vault wins an express lane round.
- Sets
is_express_lane_controller = true. - Updates
current_roundand accumulatestotal_bid_cost. - Emits
RoundWon(round, bidCost).
end_round() -> Result<()>
end_round() -> Result<()>
Called at the end of a round to reset controller status.
- Sets
is_express_lane_controller = false.
purchase_express_lane_access() -> Result<()>
purchase_express_lane_access() -> Result<()>
Buyers call this to purchase express lane access for the current round.
- Reverts if the vault is not the express lane controller.
- Collects
resale_price_usdcUSDC from the caller viatransferFrom. - Adds the caller to
authorized_buyers. - Accumulates
total_resale_earnings. - Emits
ResalePurchased(buyer, pricePaid, round).
is_authorized_buyer(buyer) -> bool
is_authorized_buyer(buyer) -> bool
set_resale_price(new_price) -> Result<()>
set_resale_price(new_price) -> Result<()>
Update the resale price. Owner only.
- Emits
ResalePriceUpdated(oldPrice, newPrice).
withdraw_eth(amount) -> Result<()>
withdraw_eth(amount) -> Result<()>
Withdraw ETH from the vault. Owner only.
- Emits
Withdrawn(to, amount, isEth: true).
withdraw_usdc(amount) -> Result<()>
withdraw_usdc(amount) -> Result<()>
Withdraw USDC from the vault. Owner only.
- Emits
Withdrawn(to, amount, isEth: false).
get_stats() -> Result<(U256, U256, U256, U256, bool)>
get_stats() -> Result<(U256, U256, U256, U256, bool)>
Returns a snapshot of vault state:
| Index | Field | Type |
|---|---|---|
| 0 | ETH balance | U256 |
| 1 | USDC balance | U256 |
| 2 | Total resale earnings | U256 |
| 3 | Total bid cost | U256 |
| 4 | Is express lane controller | bool |
Events
| Event | Indexed Fields | Data Fields |
|---|---|---|
Deposited | from | amount, isEth |
Withdrawn | to | amount, isEth |
RoundWon | round | bidCost |
ResalePurchased | buyer | pricePaid, round |
ResalePriceUpdated | — | oldPrice, newPrice |
Off-Chain Integration
The vault works in tandem with theTimeBoostBidder in the TypeScript layer:
Bid lifecycle
Bid lifecycle
- The
TimeBoostBidderestimates MEV for the next round and calculates an optimal bid. - It submits the bid to the Arbitrum TimeBoost auction.
- On a win, it calls
record_round_win(round, bidCostWei)on the vault. - During the round, users can call
purchase_express_lane_accessto buy resale slots. - At round end, the bidder calls
end_round()to reset the controller flag.
Profit tracking
Profit tracking
The
get_stats method provides a real-time view of:- Current ETH and USDC balances
- Lifetime resale earnings vs bid costs
- Whether the vault currently controls the express lane
Test Coverage
The contract has 27 tests covering:- Initialization and double-init rejection
- Access control (owner, bid agent, stranger)
- ETH and USDC deposits with event verification
- Round win recording and bid cost accumulation
- Round end and controller reset
- Express lane purchase (success, unauthorized, not-controller rejection)
- Authorized buyer tracking before and after purchase
- Earnings accumulation across multiple purchases
- Resale price updates (owner only, event emission)
- ETH and USDC withdrawals (owner only, event emission)
- Stats reporting with correct values and defaults