File tree Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,19 @@ const getSwapSchema = z.object({
262
262
} ,
263
263
example : "0x8A54C278D117854486db0F6460D901a180Fff5aa" ,
264
264
} ) ,
265
+ skipSweepDepositOut : z
266
+ . string ( )
267
+ . toLowerCase ( )
268
+ . transform ( ( s ) => JSON . parse ( s ) )
269
+ . pipe ( z . boolean ( ) )
270
+ . optional ( )
271
+ . openapi ( {
272
+ param : {
273
+ description :
274
+ "Do not add a final deposit of the output token (sweep). Leave the assets in the swapper. Useful if receiver is the Swapper" ,
275
+ } ,
276
+ example : "false" ,
277
+ } ) ,
265
278
routingOverride : z
266
279
. string ( )
267
280
. transform ( ( s ) => JSON . parse ( s ) )
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export interface SwapParams {
27
27
routingOverride ?: ChainRoutingConfig
28
28
onlyFixedInputExactOut ?: boolean // only fetch quotes where amountIn is fixed and not subject to slippage
29
29
noRepayEncoding ?: boolean // FIXME workaround for composite repays (ERC4626 strategy / overswap)
30
+ skipSweepDepositOut ?: boolean // don't add the final deposit of the bought asset (sweep), leave the assets in Swapper
30
31
}
31
32
32
33
export interface SwapQuote {
Original file line number Diff line number Diff line change @@ -277,13 +277,19 @@ export function addInOutDeposits(
277
277
5n , // avoid zero shares error
278
278
swapParams . accountIn ,
279
279
) ,
280
- encodeDepositMulticallItem (
281
- swapParams . tokenOut . addressInfo ,
282
- swapParams . receiver ,
283
- 5n , // avoid zero shares error
284
- swapParams . dustAccount ,
285
- ) ,
286
280
]
281
+
282
+ if ( ! swapParams . skipSweepDepositOut ) {
283
+ multicallItems . push (
284
+ encodeDepositMulticallItem (
285
+ swapParams . tokenOut . addressInfo ,
286
+ swapParams . receiver ,
287
+ 5n , // avoid zero shares error
288
+ swapParams . dustAccount ,
289
+ ) ,
290
+ )
291
+ }
292
+
287
293
response . swap = buildApiResponseSwap ( swapParams . from , multicallItems )
288
294
289
295
return response
You can’t perform that action at this time.
0 commit comments