Overview
TheFusionOrder class represents a Fusion swap order with Dutch auction pricing and resolver whitelisting capabilities. It extends the limit order protocol with time-based pricing curves and access control.
Constructor
FusionOrder.new()
Creates a new FusionOrder instance.Fusion extension contract address. See limit-order-settlement
Basic order parameters
Token address to sell
Token address to buy
Amount of maker asset to sell
Minimum amount of taker asset to receive
Order creator’s wallet address
Recipient address for filled orders (defaults to maker)
Random value for order uniqueness
Auction configuration
Auction pricing parameters. See AuctionDetails
Surplus fee configuration (default: NO_FEE)
Additional order options
Allow order to be filled in multiple transactions
Allow order to be filled by multiple resolvers
Automatically unwrap WETH to native ETH
Use Permit2 for token approvals
Seconds after auction ends before order expires
Required if partial or multiple fills disabled (max 40 bits)
Permit signature for gasless approvals
Source tracking identifier
Integrator and resolver fee configuration
Use zero address when maker equals receiver to save gas
Methods
build()
Builds the final order struct for submission.Order struct with maker, makerAsset, makingAmount, receiver, takerAsset, takingAmount, makerTraits, and salt
getOrderHash()
Computes the EIP-712 order hash.Network chain ID (e.g., 1 for Ethereum mainnet)
Order hash for signing
getTypedData()
Generates EIP-712 typed data for wallet signatures.Network chain ID
Typed data object for signing
calcTakingAmount()
Calculates the required taking amount at a specific time considering auction dynamics.Resolver address filling the order
Amount of maker asset being filled
Execution timestamp (Unix seconds)
Block base fee in wei
Taking amount including auction adjustments and fees
getUserReceiveAmount()
Calculates how much the user will receive after fees.Resolver address
Amount of maker asset
Execution timestamp (Unix seconds)
Block base fee in wei
Net amount user receives in taker asset
canExecuteAt()
Checks if an address can resolve the order at a given time.Resolver address to check
Timestamp to check (Unix seconds)
True if executor can fill at that time
isExclusiveResolver()
Checks if a wallet has exclusive first-fill rights.Resolver address to check
True if wallet has exclusive access period
isExclusivityPeriod()
Checks if the auction is in the exclusivity period.Timestamp to check (defaults to now)
True if in exclusivity period
isExpiredAt()
Checks if the order has expired.Timestamp to check (Unix seconds)
True if order is expired
Properties
Order creator address
Token being sold
Token being bought
Amount of maker asset
Amount of taker asset
Receiver from order struct (may be optimized to zero address)
Actual recipient of funds (resolves zero address to maker)
Order expiration timestamp (Unix seconds)
Auction start timestamp (Unix seconds)
Auction end timestamp (Unix seconds)
Encoded extension data
Whether partial fills are enabled
Whether multiple fills are enabled
Order nonce value
Order salt value
Example
Static Methods
fromNative()
Creates an order from native asset (ETH). Such orders must be submitted on-chain viaETHOrders.depositForOrder and off-chain to the relayer.
Network ID
ETHOrders proxy factory
Fusion extension contract
Order info without makerAsset (automatically set to WETH)
Auction details and whitelist
Additional options
fromDataAndExtension()
Reconstructs a FusionOrder from order struct and extension data.Order struct data
Extension bytes
Reconstructed FusionOrder instance
isNativeOrder()
Checks if an order was created from native asset.Network chain ID
ETHOrders factory
Order to check
Order signature
True if order is from native asset