@@ -43,7 +43,7 @@ type PendleData = { tx: SourceQuoteTransaction }
43
43
44
44
type ExpiredMarketsCache = {
45
45
[ chainId : number ] : {
46
- lastUpdatedUTCDate : number
46
+ lastUpdated : number
47
47
markets : {
48
48
name : string
49
49
address : Address
@@ -56,6 +56,8 @@ type ExpiredMarketsCache = {
56
56
}
57
57
}
58
58
59
+ const todayUTC = ( ) => new Date ( ) . setUTCHours ( 0 , 0 , 0 , 0 )
60
+
59
61
export class CustomPendleQuoteSource
60
62
implements IQuoteSource < PendleSupport , PendleConfig , PendleData >
61
63
{
@@ -208,12 +210,11 @@ export class CustomPendleQuoteSource
208
210
) {
209
211
if (
210
212
! this . expiredMarketsCache [ chainId ] ||
211
- this . expiredMarketsCache [ chainId ] . lastUpdatedUTCDate !==
212
- new Date ( ) . getUTCDate ( )
213
+ this . expiredMarketsCache [ chainId ] . lastUpdated !== todayUTC ( )
213
214
) {
214
215
this . expiredMarketsCache [ chainId ] = {
215
216
markets : [ ] ,
216
- lastUpdatedUTCDate : - 1 ,
217
+ lastUpdated : - 1 ,
217
218
}
218
219
219
220
const url = `${ getUrl ( ) } /${ chainId } /markets/inactive`
@@ -226,7 +227,7 @@ export class CustomPendleQuoteSource
226
227
227
228
this . expiredMarketsCache [ chainId ] = {
228
229
markets,
229
- lastUpdatedUTCDate : new Date ( ) . getUTCDate ( ) ,
230
+ lastUpdated : todayUTC ( ) ,
230
231
}
231
232
}
232
233
}
0 commit comments