Skip to content

Commit 0b6ab25

Browse files
authored
feat: unregister expired pendle assets (#750)
1 parent ccbbe65 commit 0b6ab25

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

.changeset/unlucky-frogs-wash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@enzymefinance/environment": patch
3+
---
4+
5+
Unregister expired Pendle assets

packages/environment/scripts/unregister-expired-pendle-assets.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fs from "node:fs";
22
import path from "node:path";
33
import { fileURLToPath } from "node:url";
4+
import { Constants } from "@enzymefinance/sdk/Utils";
45
import jscodeshift from "jscodeshift";
56

67
const __filename = fileURLToPath(import.meta.url);
@@ -22,7 +23,10 @@ function isExpired(symbol) {
2223
}
2324
const dateStr = match[0];
2425
const date = new Date(Date.parse(dateStr.replace(/(\d{2})([A-Z]{3})(\d{4})/, "$1 $2 $3")));
25-
return date < new Date();
26+
27+
const expirationTime = new Date().getTime() - Number(Constants.ONE_WEEK_IN_SECONDS) * 1000 * 2; // expired for 2 weeks
28+
29+
return date.getTime() < expirationTime;
2630
}
2731

2832
const unregisteredAssets: Array<string> = [];

packages/environment/src/assets/ethereum.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7789,28 +7789,24 @@ export default defineAssetList(Network.ETHEREUM, [
77897789
name: "PT Syrup USDC 24APR2025",
77907790
id: "0x2beeb2c4809954e5b514a3205afbdc097eb810b4",
77917791
type: AssetType.PENDLE_V2_PT,
7792-
releases: [sulu],
7792+
releases: [],
77937793
decimals: 6,
77947794
underlying: "0x80ac24aa929eaf5013f6436cda2a7ba190f5cc0b",
77957795
markets: ["0x580e40c15261f7baf18ea50f562118ae99361096"],
77967796
priceFeed: {
7797-
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
7798-
aggregator: "0x731573deb7da9aaaee9e7d848a69e38bb89bb93b",
7799-
rateAsset: RateAsset.ETH,
7797+
type: PriceFeedType.NONE,
78007798
},
78017799
},
78027800
{
78037801
symbol: "LP-syrupUSDC-24APR2025",
78047802
name: "LP Syrup USDC 24APR2025",
78057803
id: "0x580e40c15261f7baf18ea50f562118ae99361096",
78067804
type: AssetType.PENDLE_V2_LP,
7807-
releases: [sulu],
7805+
releases: [],
78087806
decimals: 18,
78097807
underlying: "0x80ac24aa929eaf5013f6436cda2a7ba190f5cc0b",
78107808
priceFeed: {
7811-
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
7812-
aggregator: "0x9c5da2b4c3474223b224ef42ae1b5fd6c90c7b99",
7813-
rateAsset: RateAsset.ETH,
7809+
type: PriceFeedType.NONE,
78147810
},
78157811
},
78167812
{
@@ -7833,28 +7829,24 @@ export default defineAssetList(Network.ETHEREUM, [
78337829
name: "PT SuperUSDC 17APR2025",
78347830
id: "0x8fa8da847bc3e8a945bae061c73af74df6375a95",
78357831
type: AssetType.PENDLE_V2_PT,
7836-
releases: [sulu],
7832+
releases: [],
78377833
decimals: 6,
78387834
underlying: "0xf7de3c70f2db39a188a81052d2f3c8e3e217822a",
78397835
markets: ["0x1bd1ae9d7a377e63cd0c584a2c42b8c614937e81"],
78407836
priceFeed: {
7841-
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
7842-
aggregator: "0xf3088fcd8dcd2d18939544023ba408bd7a201c02",
7843-
rateAsset: RateAsset.ETH,
7837+
type: PriceFeedType.NONE,
78447838
},
78457839
},
78467840
{
78477841
symbol: "LP-ysUSDC-17APR2025",
78487842
name: "LP SuperUSDC 17APR2025",
78497843
id: "0x1bd1ae9d7a377e63cd0c584a2c42b8c614937e81",
78507844
type: AssetType.PENDLE_V2_LP,
7851-
releases: [sulu],
7845+
releases: [],
78527846
decimals: 18,
78537847
underlying: "0xf7de3c70f2db39a188a81052d2f3c8e3e217822a",
78547848
priceFeed: {
7855-
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
7856-
aggregator: "0x06c9c8ff33b05f92993c06083f8e49c6651fd003",
7857-
rateAsset: RateAsset.ETH,
7849+
type: PriceFeedType.NONE,
78587850
},
78597851
},
78607852
{

0 commit comments

Comments
 (0)