Build Fusion order from quote
Builds a Fusion order from a previously received quote. Returns EIP-712 typed data that needs to be signed by the wallet to submit the order.
Supported on: Ethereum Base Solana BNB Chain Avalanche ZKsync Gnosis Optimism Polygon Linea Sonic Unichain Arbitrum
Parameters
chain
* number path fee
number queryDeprecated. Partner fee in basis points (1% = 100 bps). Use `integratorFee` from the quote response instead. If provided, overrides the quote fee.
isPermit2
boolean queryWhether the permit is in Permit2 format
preset
string (Enum)queryPreset to use for the order (fast, medium, slow, custom)
additionalAuctionStartDelay
number queryAdditional auction start delay in seconds (useful for multisig wallets)
receiver
string queryAddress that will receive the destination tokens (if different from walletAddress)
permit
string queryPermit signature for gasless token approval
feeReceiver
string queryDeprecated. Partner fee receiver address (EVM address). Use `integratorFeeReceiver` from the quote response instead. If provided, this value overrides the receiver from the quote.
walletAddress
* string queryAddress of the wallet that will sign the order
amount
* string queryAmount of source token to swap (in minimal divisible units)
toTokenAddress
* string queryAddress of the destination token
fromTokenAddress
* string queryAddress of the source token
Request Body
Quote response containing swap parameters, presets, and pricing information for creating a Fusion order
quoteId
* object Current generated quote id, should be passed with order
fromTokenAmount
* string Amount of source token to swap
toTokenAmount
* string Expected amount of destination token to receive
feeToken
* object Destination token address
fee
*ResolverFee object Resolver fee configuration including receiver address and basis points
receiver
* string Resolver fee receiver
bps
* number Resolver fee bps
whitelistDiscountPercent
* number Discount percentage for whitelisted resolvers
integratorFee
* number Integrator fee in basis points
integratorFeeReceiver
string Address of integrator fee receiver
presets
* any Various preset types which user can choose when using Fusion
allOf[0]
QuotePresetsClass object Collection of preset configurations for different execution strategies
fast
* any Fast preset type
allOf[0]
PresetClass object Auction preset configuration with timing, amounts, and execution parameters
bankFee
* string Bank fee amount in token units
auctionDuration
* number Duration of the auction in seconds
startAuctionIn
* number Delay before auction starts in seconds
initialRateBump
* number Initial rate bump percentage (in basis points)
auctionStartAmount
* string Starting amount for the auction
startAmount
* string auction start amount taking into account gas bump
auctionEndAmount
* string Ending amount for the auction
exclusiveResolver
* object Address of exclusive resolver, if any
tokenFee
* string Token fee amount
estP
* number Estimated probability of execution
points
* array Auction price curve points
items
AuctionPointClass object Point in the auction price curve defining rate changes over time
delay
* number Delay in seconds from previous point or auction start time
coefficient
* number Rate bump coefficient from order min taker amount
allowPartialFills
* boolean Whether partial fills are allowed
allowMultipleFills
* boolean Whether multiple fills are allowed
gasCost
*GasCostConfigClass object Gas cost estimation parameters for order execution
gasBumpEstimate
* number Estimated gas bump for execution
gasPriceEstimate
* string Estimated gas price in wei
medium
* any Medium preset type
allOf[0]
PresetClass object Auction preset configuration with timing, amounts, and execution parameters
bankFee
* string Bank fee amount in token units
auctionDuration
* number Duration of the auction in seconds
startAuctionIn
* number Delay before auction starts in seconds
initialRateBump
* number Initial rate bump percentage (in basis points)
auctionStartAmount
* string Starting amount for the auction
startAmount
* string auction start amount taking into account gas bump
auctionEndAmount
* string Ending amount for the auction
exclusiveResolver
* object Address of exclusive resolver, if any
tokenFee
* string Token fee amount
estP
* number Estimated probability of execution
points
* array Auction price curve points
items
AuctionPointClass object Point in the auction price curve defining rate changes over time
delay
* number Delay in seconds from previous point or auction start time
coefficient
* number Rate bump coefficient from order min taker amount
allowPartialFills
* boolean Whether partial fills are allowed
allowMultipleFills
* boolean Whether multiple fills are allowed
gasCost
*GasCostConfigClass object Gas cost estimation parameters for order execution
gasBumpEstimate
* number Estimated gas bump for execution
gasPriceEstimate
* string Estimated gas price in wei
slow
* any Slow preset type
allOf[0]
PresetClass object Auction preset configuration with timing, amounts, and execution parameters
bankFee
* string Bank fee amount in token units
auctionDuration
* number Duration of the auction in seconds
startAuctionIn
* number Delay before auction starts in seconds
initialRateBump
* number Initial rate bump percentage (in basis points)
auctionStartAmount
* string Starting amount for the auction
startAmount
* string auction start amount taking into account gas bump
auctionEndAmount
* string Ending amount for the auction
exclusiveResolver
* object Address of exclusive resolver, if any
tokenFee
* string Token fee amount
estP
* number Estimated probability of execution
points
* array Auction price curve points
items
AuctionPointClass object Point in the auction price curve defining rate changes over time
delay
* number Delay in seconds from previous point or auction start time
coefficient
* number Rate bump coefficient from order min taker amount
allowPartialFills
* boolean Whether partial fills are allowed
allowMultipleFills
* boolean Whether multiple fills are allowed
gasCost
*GasCostConfigClass object Gas cost estimation parameters for order execution
gasBumpEstimate
* number Estimated gas bump for execution
gasPriceEstimate
* string Estimated gas price in wei
custom
any Custom preset type
allOf[0]
PresetClass object Auction preset configuration with timing, amounts, and execution parameters
bankFee
* string Bank fee amount in token units
auctionDuration
* number Duration of the auction in seconds
startAuctionIn
* number Delay before auction starts in seconds
initialRateBump
* number Initial rate bump percentage (in basis points)
auctionStartAmount
* string Starting amount for the auction
startAmount
* string auction start amount taking into account gas bump
auctionEndAmount
* string Ending amount for the auction
exclusiveResolver
* object Address of exclusive resolver, if any
tokenFee
* string Token fee amount
estP
* number Estimated probability of execution
points
* array Auction price curve points
items
AuctionPointClass object Point in the auction price curve defining rate changes over time
delay
* number Delay in seconds from previous point or auction start time
coefficient
* number Rate bump coefficient from order min taker amount
allowPartialFills
* boolean Whether partial fills are allowed
allowMultipleFills
* boolean Whether multiple fills are allowed
gasCost
*GasCostConfigClass object Gas cost estimation parameters for order execution
gasBumpEstimate
* number Estimated gas bump for execution
gasPriceEstimate
* string Estimated gas price in wei
settlementAddress
* string settlement contract address
nativeOrderFactoryAddress
string Factory for native order submission, only present when src asset is native
nativeOrderImplAddress
string Implementation for `nativeOrderFactoryAddress`, only present when src asset is native
whitelist
* array current executors whitelist addresses
items
string recommended_preset
* string (Enum)suggested to use this preset
fast
medium
slow
custom
suggested
* boolean is it suggested to use Fusion
prices
*TokenPairValue object Token pair prices in various currencies
usd
*PairCurrencyValue object Token pair price values in a specific currency
fromToken
* string Price or volume of the source token
toToken
* string Price or volume of the destination token
volume
*TokenPairValue object Token pair prices in various currencies
usd
*PairCurrencyValue object Token pair price values in a specific currency
fromToken
* string Price or volume of the source token
toToken
* string Price or volume of the destination token
source
string Server-resolved source tracking code. SDK clients should use this for order building.
surplusFee
* number Surplus fee in percent
JavaScript
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
const axios = require('axios');
async function httpCall() {
const url = 'https://api.1inch.com/fusion/quoter/v2.0/{chain}/quote/build';
const config = {
headers: {
Authorization: `Bearer ${API_KEY}`,
},
params: {
fee: 0,
isPermit2: false,
additionalAuctionStartDelay: 30,
receiver: '0x0000000000000000000000000000000000000000',
permit: '0x',
feeReceiver: '0x0000000000000000000000000000000000000000',
walletAddress: '0x0000000000000000000000000000000000000000',
amount: '1000000000000000000',
toTokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f',
fromTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
},
paramsSerializer: {
indexes: null,
},
};
const body = {
quoteId: null,
fromTokenAmount: 'string',
toTokenAmount: 'string',
feeToken: null,
fee: {
receiver: 'string',
bps: 0,
whitelistDiscountPercent: 0,
},
integratorFee: 0,
integratorFeeReceiver: 'string',
integratorFeeShare: 0,
presets: {
fast: {
bankFee: 'string',
auctionDuration: 0,
startAuctionIn: 0,
initialRateBump: 0,
auctionStartAmount: 'string',
startAmount: 'string',
auctionEndAmount: 'string',
exclusiveResolver: null,
tokenFee: 'string',
estP: 0,
points: [
{
delay: 0,
coefficient: 0,
},
],
allowPartialFills: false,
allowMultipleFills: false,
gasCost: {
gasBumpEstimate: 0,
gasPriceEstimate: 'string',
},
},
medium: {
bankFee: 'string',
auctionDuration: 0,
startAuctionIn: 0,
initialRateBump: 0,
auctionStartAmount: 'string',
startAmount: 'string',
auctionEndAmount: 'string',
exclusiveResolver: null,
tokenFee: 'string',
estP: 0,
points: [
{
delay: 0,
coefficient: 0,
},
],
allowPartialFills: false,
allowMultipleFills: false,
gasCost: {
gasBumpEstimate: 0,
gasPriceEstimate: 'string',
},
},
slow: {
bankFee: 'string',
auctionDuration: 0,
startAuctionIn: 0,
initialRateBump: 0,
auctionStartAmount: 'string',
startAmount: 'string',
auctionEndAmount: 'string',
exclusiveResolver: null,
tokenFee: 'string',
estP: 0,
points: [
{
delay: 0,
coefficient: 0,
},
],
allowPartialFills: false,
allowMultipleFills: false,
gasCost: {
gasBumpEstimate: 0,
gasPriceEstimate: 'string',
},
},
custom: {
bankFee: 'string',
auctionDuration: 0,
startAuctionIn: 0,
initialRateBump: 0,
auctionStartAmount: 'string',
startAmount: 'string',
auctionEndAmount: 'string',
exclusiveResolver: null,
tokenFee: 'string',
estP: 0,
points: [
{
delay: 0,
coefficient: 0,
},
],
allowPartialFills: false,
allowMultipleFills: false,
gasCost: {
gasBumpEstimate: 0,
gasPriceEstimate: 'string',
},
},
},
settlementAddress: 'string',
nativeOrderFactoryAddress: 'string',
nativeOrderImplAddress: 'string',
whitelist: ['string'],
recommended_preset: 'fast',
suggested: false,
prices: {
usd: {
fromToken: 'string',
toToken: 'string',
},
},
volume: {
usd: {
fromToken: 'string',
toToken: 'string',
},
},
source: 'string',
surplusFee: 0,
};
try {
const response = await axios.post(url, body, config);
console.log(response.data);
} catch (error) {
console.error(error);
}
}
Returns
200
400
default
200 response doesn’t have payload.