Documentation Index
Fetch the complete documentation index at: https://cowswap-mintlify-seo-audit-1777280932.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Value Factories
Value Factories enable dynamic storage of on-chain snapshots within ComposableCoW’s “cabinet” system, allowing for storing on-chain values in the ComposableCoW cabinet at the time of order creation.Key Technical Components
IValueFactory Interface
The simplest implementation requires a singlegetValue() function that reads on-chain state and returns a bytes32 value that gets stored in the cabinet.
Cabinet Storage Structure
ComposableCoW maintains a nested mapping using:- First key: Owner address
- Second key: Context identifier
- Value: Corresponding
bytes32value
Primary Use Cases
1. Time-based Orders
TheCurrentBlockTimestampFactory captures block timestamps, enabling time-locked trading strategies and expiration mechanisms.
2. Price Snapshots
TheChainlinkPriceFactory example demonstrates capturing token prices via oracle data at creation time.
3. Balance Snapshots
TheTokenBalanceFactory stores account balances as contextual references.
4. Composite Storage
Multiple values can be packed into singlebytes32 entries for efficiency.