Skip to content

feat: add pendle v2 assets #663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 27, 2025
5 changes: 5 additions & 0 deletions .changeset/beige-tigers-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@enzymefinance/environment": patch
---

Add Pendle V2 assets
3 changes: 3 additions & 0 deletions packages/environment/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,11 @@ export interface ERC4626Asset extends AssetBase {
export enum Erc4626Protocol {
ANGLE = "ANGLE",
MORPHO = "MORPHO",
RESOLV = "RESOLV",
SKY = "SKY",
SPARK = "SPARK",
SUPERFORM = "SUPERFORM",
SYRUP = "SYRUP",
VAULTCRAFT = "VAULTCRAFT",
}

Expand Down
216 changes: 216 additions & 0 deletions packages/environment/src/assets/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7715,4 +7715,220 @@ export default defineAssetList(Network.ETHEREUM, [
rateAsset: RateAsset.USD,
},
},
{
symbol: "PT-stETH-25DEC2025",
name: "PT stETH 25DEC2025",
id: "0xf99985822fb361117fcf3768d34a6353e6022f5f",
type: AssetType.PENDLE_V2_PT,
releases: [sulu],
decimals: 18,
underlying: "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0",
markets: ["0xc374f7ec85f8c7de3207a10bb1978ba104bda3b2"],
priceFeed: {
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
aggregator: "0x2f87e86e0da687c590508717904633e341fc17b5",
rateAsset: RateAsset.ETH,
},
},
{
decimals: 18,
id: "0xd11c452fc99cf405034ee446803b6f6c1f6d5ed8",
name: "Treehouse ETH",
releases: [sulu],
symbol: "tETH",
type: AssetType.PRIMITIVE,
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_QUOTED,
aggregator: "0x8610172c4ea038a69565d9522db7187b34003761",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "PT-tETH-29MAY2025",
name: "PT Treehouse ETH 29MAY2025",
id: "0x84d17ef6bec165484c320b852eeb294203e191be",
type: AssetType.PENDLE_V2_PT,
releases: [sulu],
decimals: 18,
underlying: "0xd11c452fc99cf405034ee446803b6f6c1f6d5ed8",
markets: ["0xbdb8f9729d3194f75fd1a3d9bc4ffe0dde3a404c"],
priceFeed: {
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
aggregator: "0x8cbdd4e6b5e79578f23f8216ab67777d788407d5",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "PT-weETH-26JUN2025",
name: "PT ether.fi weETH 26JUN2025",
id: "0xef6122835a2bbf575d0117d394fda24ab7d09d4e",
type: AssetType.PENDLE_V2_PT,
releases: [sulu],
decimals: 18,
underlying: "0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee",
markets: ["0xf4cf59259d007a96c641b41621ab52c93b9691b1"],
priceFeed: {
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
aggregator: "0x8dda8b784d288a8a7f073a8e20617139fca02801",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "PT-sUSDS-27MAR2025",
name: "PT Savings USDS 27MAR2025",
id: "0x152b8629fee8105248ba3b7ba6afb94f7a468302",
type: AssetType.PENDLE_V2_PT,
releases: [sulu],
markets: ["0xd3719a10991b6ca2cd32de536d6e81ccd46e9c02"],
decimals: 18,
underlying: "0xa3931d71877c0e7a3148cb7eb4463524fec27fbd",
priceFeed: {
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
aggregator: "0xc20fef0e0c7f85c6a61dc50abe8e2d6fd862e979",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "LP-sUSDS-27MAR2025",
name: "LP Savings USDS 27MAR2025",
id: "0xd3719a10991b6ca2cd32de536d6e81ccd46e9c02",
type: AssetType.PENDLE_V2_LP,
releases: [],
decimals: 18,
underlying: "0xa3931d71877c0e7a3148cb7eb4463524fec27fbd",
priceFeed: {
type: PriceFeedType.NONE,
},
},
{
decimals: 18,
id: "0x66a1e37c9b0eaddca17d3662d6c05f4decf3e110",
name: "Resolv USD",
releases: [sulu],
symbol: "USR",
type: AssetType.PRIMITIVE,
priceFeed: {
type: PriceFeedType.PRIMITIVE_REDSTONE,
aggregator: "0x107dd3391a6357248f2093698014e7c6130779ee",
rateAsset: RateAsset.USD,
},
},
{
symbol: "wstUSR",
name: "Wrapped stUSR",
id: "0x1202f5c7b4b9e47a1a484e8b270be34dbbc75055",
type: AssetType.ERC_4626,
protocol: Erc4626Protocol.RESOLV,
releases: [sulu],
decimals: 18,
underlying: "0x66a1e37c9b0eaddca17d3662d6c05f4decf3e110",
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_ERC4626,
aggregator: "0xe825080d444aa2772ece2648b48c320f8ddfbe62",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "PT-wstUSR-25SEP2025",
name: "PT Wrapped stUSR 25SEP2025",
id: "0x23e60d1488525bf4685f53b3aa8e676c30321066",
type: AssetType.PENDLE_V2_PT,
releases: [sulu],
decimals: 18,
underlying: "0x1202f5c7b4b9e47a1a484e8b270be34dbbc75055",
markets: ["0x09fa04aac9c6d1c6131352ee950cd67ecc6d4fb9"],
priceFeed: {
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
aggregator: "0x6ccfbea0ed4dc77fe5167ea057eb603e31c98e2c",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "syrupUSDC",
name: "Syrup USDC",
id: "0x80ac24aa929eaf5013f6436cda2a7ba190f5cc0b",
type: AssetType.ERC_4626,
protocol: Erc4626Protocol.SYRUP,
releases: [sulu],
decimals: 6,
underlying: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_ERC4626,
aggregator: "0x740ee3b8e79ee324c66b33c227d3cd23f413200d",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "PT-syrupUSDC-24APR2025",
name: "PT Syrup USDC 24APR2025",
id: "0x2beeb2c4809954e5b514a3205afbdc097eb810b4",
type: AssetType.PENDLE_V2_PT,
releases: [sulu],
decimals: 6,
underlying: "0x80ac24aa929eaf5013f6436cda2a7ba190f5cc0b",
markets: ["0x580e40c15261f7baf18ea50f562118ae99361096"],
priceFeed: {
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
aggregator: "0x731573deb7da9aaaee9e7d848a69e38bb89bb93b",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "LP-syrupUSDC-24APR2025",
name: "LP Syrup USDC 24APR2025",
id: "0x580e40c15261f7baf18ea50f562118ae99361096",
type: AssetType.PENDLE_V2_LP,
releases: [sulu],
decimals: 18,
underlying: "0x80ac24aa929eaf5013f6436cda2a7ba190f5cc0b",
priceFeed: {
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
aggregator: "0x9c5da2b4c3474223b224ef42ae1b5fd6c90c7b99",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "ysUSDC",
name: "SuperUSDC",
id: "0xf7de3c70f2db39a188a81052d2f3c8e3e217822a",
type: AssetType.ERC_4626,
protocol: Erc4626Protocol.SUPERFORM,
releases: [sulu],
decimals: 6,
underlying: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_ERC4626,
aggregator: "0xfba3c30dfcac70eaf60ee01c1c9f3e452c5020f8",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "PT-ysUSDC-17APR2025",
name: "PT SuperUSDC 17APR2025",
id: "0x8fa8da847bc3e8a945bae061c73af74df6375a95",
type: AssetType.PENDLE_V2_PT,
releases: [sulu],
decimals: 6,
underlying: "0xf7de3c70f2db39a188a81052d2f3c8e3e217822a",
markets: ["0x1bd1ae9d7a377e63cd0c584a2c42b8c614937e81"],
priceFeed: {
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
aggregator: "0xf3088fcd8dcd2d18939544023ba408bd7a201c02",
rateAsset: RateAsset.ETH,
},
},
{
symbol: "LP-ysUSDC-17APR2025",
name: "LP SuperUSDC 17APR2025",
id: "0x1bd1ae9d7a377e63cd0c584a2c42b8c614937e81",
type: AssetType.PENDLE_V2_LP,
releases: [sulu],
decimals: 18,
underlying: "0xf7de3c70f2db39a188a81052d2f3c8e3e217822a",
priceFeed: {
type: PriceFeedType.PRIMITIVE_PENDLE_V2,
aggregator: "0x06c9c8ff33b05f92993c06083f8e49c6651fd003",
rateAsset: RateAsset.ETH,
},
},
]);
30 changes: 30 additions & 0 deletions packages/environment/src/price-feeds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export enum PriceFeedType {
WETH = "WETH",
PRIMITIVE_CHAINLINK = "PRIMITIVE_CHAINLINK",
PRIMITIVE_CHAINLINK_LIKE_ETHX = "PRIMITIVE_CHAINLINK_LIKE_ETHX",
PRIMITIVE_CHAINLINK_LIKE_ERC4626 = "PRIMITIVE_CHAINLINK_LIKE_ERC4626",
PRIMITIVE_CHAINLINK_LIKE_QUOTED = "PRIMITIVE_CHAINLINK_LIKE_QUOTED",
PRIMITIVE_CHAINLINK_LIKE_WSTETH = "PRIMITIVE_CHAINLINK_LIKE_WSTETH",
PRIMITIVE_CHAINLINK_LIKE_YNETH = "PRIMITIVE_CHAINLINK_LIKE_YNETH",
PRIMITIVE_REDSTONE = "PRIMITIVE_REDSTONE",
Expand All @@ -30,6 +32,8 @@ export enum PriceFeedType {
export const primitivePriceFeeds = [
PriceFeedType.PRIMITIVE_CHAINLINK,
PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_ETHX,
PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_ERC4626,
PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_QUOTED,
PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_WSTETH,
PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_YNETH,
PriceFeedType.PRIMITIVE_REDSTONE,
Expand Down Expand Up @@ -64,6 +68,8 @@ export type PriceFeed =
| WethPriceFeed
| PrimitiveChainlinkPriceFeed
| PrimitiveChainlinkLikeEthxPriceFeed
| PrimitiveChainlinkLikeERC4626PriceFeed
| PrimitiveChainlinkLikeQuotedPriceFeed
| PrimitiveChainlinkLikeWstEthPriceFeed
| PrimitiveChainlinkLikeYnEthPriceFeed
| PrimitiveRedstonePriceFeed
Expand Down Expand Up @@ -110,6 +116,18 @@ export interface PrimitiveChainlinkPriceFeed extends PriceFeedBase {
readonly rateAsset: RateAsset;
}

export interface PrimitiveChainlinkLikeQuotedPriceFeed extends PriceFeedBase {
readonly type: PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_QUOTED;
/**
* Aggregator address
*/
readonly aggregator: Address;
/**
* Rate Asset (ETH = 0, USD = 1)
*/
readonly rateAsset: RateAsset.ETH;
}

export interface PrimitiveChainlinkLikeWstEthPriceFeed extends PriceFeedBase {
readonly type: PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_WSTETH;
/**
Expand All @@ -122,6 +140,18 @@ export interface PrimitiveChainlinkLikeWstEthPriceFeed extends PriceFeedBase {
readonly rateAsset: RateAsset.ETH;
}

export interface PrimitiveChainlinkLikeERC4626PriceFeed extends PriceFeedBase {
readonly type: PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_ERC4626;
/**
* Aggregator address
*/
readonly aggregator: Address;
/**
* Rate Asset (ETH = 0, USD = 1)
*/
readonly rateAsset: RateAsset;
}

export interface PrimitiveChainlinkLikeYnEthPriceFeed extends PriceFeedBase {
readonly type: PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_YNETH;
/**
Expand Down
5 changes: 4 additions & 1 deletion packages/environment/test/assets/pendle-v2-price.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { getPendleAssetPrice } from "../utils/pendle.js";

const client = getClient(environment.network.id);

const pendleV2Assets = environment.getAssets({ types: [AssetType.PENDLE_V2_PT, AssetType.PENDLE_V2_LP] });
const pendleV2Assets = environment.getAssets({
types: [AssetType.PENDLE_V2_PT, AssetType.PENDLE_V2_LP],
registered: true,
});

suite("prices are correct", async () => {
const valueInterpreter = environment.getContract("ValueInterpreter");
Expand Down
4 changes: 4 additions & 0 deletions packages/environment/test/assets/price-feed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ suite.each(assets)("$symbol ($name): $id", (asset) => {
}

case PriceFeedType.PRIMITIVE_CHAINLINK:
case PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_QUOTED:
case PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_ETHX:
case PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_ERC4626:
case PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_WSTETH:
case PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_YNETH:
case PriceFeedType.PRIMITIVE_REDSTONE:
Expand Down Expand Up @@ -234,6 +236,8 @@ suite.each(assets)("$symbol ($name): $id", (asset) => {
case PriceFeedType.WETH:
case PriceFeedType.PRIMITIVE_CHAINLINK:
case PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_ETHX:
case PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_ERC4626:
case PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_QUOTED:
case PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_WSTETH:
case PriceFeedType.PRIMITIVE_CHAINLINK_LIKE_YNETH:
case PriceFeedType.PRIMITIVE_REDSTONE:
Expand Down
Loading