@@ -33,7 +33,7 @@ type CustomOrAPIKeyConfig =
3333 | { customUrl : string ; apiKey ?: undefined }
3434 | { customUrl ?: undefined ; apiKey : string }
3535type PendleConfig = CustomOrAPIKeyConfig
36- type PendleData = { tx : SourceQuoteTransaction }
36+ type PendleData = { tx : SourceQuoteTransaction ; pendleAggregator : string }
3737
3838export class CustomPendleQuoteSource
3939 implements IQuoteSource < PendleSupport , PendleConfig , PendleData >
@@ -64,7 +64,7 @@ export class CustomPendleQuoteSource
6464 async quote (
6565 params : QuoteParams < PendleSupport , PendleConfig > ,
6666 ) : Promise < SourceQuoteResponse < PendleData > > {
67- const { dstAmount, to, data } = await this . getQuote ( params )
67+ const { dstAmount, to, data, aggregator } = await this . getQuote ( params )
6868 const quote = {
6969 sellAmount : params . request . order . sellAmount ,
7070 buyAmount : BigInt ( dstAmount ) ,
@@ -74,6 +74,7 @@ export class CustomPendleQuoteSource
7474 to,
7575 calldata : data ,
7676 } ,
77+ pendleAggregator : aggregator ,
7778 } ,
7879 }
7980
@@ -166,14 +167,14 @@ export class CustomPendleQuoteSource
166167
167168 failed ( this . getMetadata ( ) , chainId , sellToken , buyToken , msg )
168169 }
169-
170170 const { routes } = await response . json ( )
171171
172172 const dstAmount = routes [ 0 ] . outputs [ 0 ] . amount
173173 const to = routes [ 0 ] . tx . to
174174 const data = routes [ 0 ] . tx . data
175+ const aggregator = routes [ 0 ] . data . aggregatorType
175176
176- return { dstAmount, to, data }
177+ return { dstAmount, to, data, aggregator }
177178 }
178179
179180 isConfigAndContextValidForQuoting (
0 commit comments