Skip to main content

Overview

The AuctionDetails class encapsulates auction parameters including:
  • Auction start time and duration
  • Initial rate bump (starting premium)
  • Price curve definition via points
  • Gas cost adjustments
These parameters define how the order’s price improves over time, creating a Dutch auction where resolvers compete to fill the order at the best price.

Constructor

Creates a new AuctionDetails instance.
auction
object
required
Auction configuration parameters
startTime
bigint
required
Unix timestamp in seconds when the auction begins
duration
bigint
required
Auction duration in seconds (max: 16,777,215)
initialRateBump
number
required
Starting price premium as ratio of startTakingAmount to endTakingAmount. Scale: 10,000,000 = 100%. Example: 50,000 = 0.5%
points
AuctionPoint[]
required
Array defining the price curve
coefficient
number
required
Rate bump for auctionEndAmount at this point. Scale: 10,000,000 = 100%
delay
number
required
Time in seconds relative to previous point (or auction start for first point)
gasCost
AuctionGasCostInfo
Gas cost estimation for dynamic adjustments
gasBumpEstimate
bigint
required
Rate bump to cover gas costs. Ratio of gasCostInToToken to endTakingAmount. Scale: 10,000,000 = 100%
gasPriceEstimate
bigint
required
Gas price at estimation time. Scale: 1000 = 1 Gwei

Methods

encode()

Serializes auction data to bytes for on-chain use.
const encoded = details.encode()
// => '0x63c051750000b400c350009c40000a009c40000a'
return
string
Hex-encoded auction data with 0x prefix

encodeInto()

Serializes auction data into a BytesBuilder.
builder
BytesBuilder
Optional BytesBuilder instance (creates new if not provided)
const builder = new BytesBuilder()
details.encodeInto(builder)
return
BytesBuilder
Builder with encoded auction data

Properties

startTime
bigint
Auction start timestamp (Unix seconds)
duration
bigint
Auction duration in seconds
initialRateBump
bigint
Initial rate bump value
points
AuctionPoint[]
Price curve points
gasCost
object
Gas cost configuration
gasBumpEstimate
bigint
Rate bump to cover gas (10,000,000 = 100%)
gasPriceEstimate
bigint
Estimated gas price (1000 = 1 Gwei)

Static Methods

decode()

Decodes auction details from hex bytes.
data
string
required
Hex-encoded auction data with 0x prefix
import {AuctionDetails} from '@1inch/fusion-sdk'

const details = AuctionDetails.decode('0x63c051750000b400c350009c40000a009c40000a')
return
AuctionDetails
Decoded AuctionDetails instance

decodeFrom()

Decodes auction details from a BytesIter.
iter
BytesIter<bigint | string>
required
BytesIter positioned at auction data
const iter = BytesIter.BigInt('0x...')
const details = AuctionDetails.decodeFrom(iter)
return
AuctionDetails
Decoded AuctionDetails instance

fromExtension()

Extracts auction details from a limit order extension.
extension
Extension
required
Extension object containing auction data
const details = AuctionDetails.fromExtension(extension)
return
AuctionDetails
Extracted AuctionDetails instance

Example

import {AuctionDetails} from '@1inch/fusion-sdk'

const details = new AuctionDetails({
    duration: 180n, // 3 minutes
    startTime: 1673548149n, // Unix timestamp
    /**
     * Starting premium: 0.5%
     * Defined as ratio of startTakingAmount to endTakingAmount
     * 10,000,000 = 100%
     */
    initialRateBump: 50000,
    /**
     * Points defining the price curve:
     * 
     * y(rate) ▲
     *         │
     *    5000 │\\
     *         │ \\
     *         │  \\
     *    4000 │   \\───────
     *         │           \\
     *         │            \\
     *    3000 │             \\
     *         │              \\
     *         └─────────────────────────►
     *         0   10     20  end   x(time)
     */
    points: [
        {
            delay: 10, // 10 seconds from auction start
            coefficient: 40000 // 0.4% rate bump
        },
        {
            delay: 10, // 10 seconds from previous point
            coefficient: 40000 // 0.4% rate bump
        }
    ],
    /**
     * Adjusts estimated gas costs to actual onchain costs
     */
    gasCost: {
        /**
         * Rate bump to cover gas: 0.1%
         * Ratio of gasCostInToToken to endTakingAmount
         */
        gasBumpEstimate: 10_000n,
        /**
         * Gas price estimate: 1 Gwei
         */
        gasPriceEstimate: 1000n
    }
})

const encoded = details.encode()
// => '0x63c051750000b400c350009c40000a009c40000a'

// Decode back
const decoded = AuctionDetails.decode(encoded)

Price Curve Mechanics

The auction price starts high and decreases over time according to the defined points:
  1. Initial Rate Bump: Premium at auction start
  2. Points: Define how quickly price decreases
  3. Coefficient: Rate adjustment at each point
  4. Delay: Time between points
Resolvers monitor the price curve and fill when profitable. Earlier fills get worse prices but guaranteed execution; later fills get better prices but risk being frontrun.

Gas Cost Adjustment

The gasCost parameter allows dynamic gas compensation:
  • gasBumpEstimate: Expected gas cost as rate bump
  • gasPriceEstimate: Gas price when estimate was made
On-chain, actual gas costs are calculated and adjusted proportionally, ensuring resolvers are compensated for current gas prices rather than estimated prices.

Build docs developers (and LLMs) love