From a14363c9f852e2b5961438505d38fbe06dd20421 Mon Sep 17 00:00:00 2001 From: Van0k Date: Wed, 11 Sep 2024 13:26:32 +0400 Subject: [PATCH] fix: add missing pendle price feed test deployment --- contracts/test/suites/PriceFeedDeployer.sol | 34 ++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/contracts/test/suites/PriceFeedDeployer.sol b/contracts/test/suites/PriceFeedDeployer.sol index bd2448d..ce44bf6 100644 --- a/contracts/test/suites/PriceFeedDeployer.sol +++ b/contracts/test/suites/PriceFeedDeployer.sol @@ -25,7 +25,8 @@ import { TheSamePriceFeedData, BalancerLPPriceFeedData, RedStonePriceFeedData, - PythPriceFeedData + PythPriceFeedData, + PendlePriceFeedData } from "@gearbox-protocol/sdk-gov/contracts/PriceFeedDataLive.sol"; import {PriceFeedConfig} from "@gearbox-protocol/core-v3/contracts/test/interfaces/ICreditConfig.sol"; import {PriceOracleV3} from "@gearbox-protocol/core-v3/contracts/core/PriceOracleV3.sol"; @@ -48,6 +49,7 @@ import {PriceFeedParams} from "../../oracles/PriceFeedParams.sol"; import {ZeroPriceFeed} from "../../oracles/ZeroPriceFeed.sol"; import {PythPriceFeed} from "../../oracles/updatable/PythPriceFeed.sol"; import {MellowLRTPriceFeed} from "../../oracles/mellow/MellowLRTPriceFeed.sol"; +import {PendleTWAPPTPriceFeed} from "../../oracles/pendle/PendleTWAPPTPriceFeed.sol"; import {IBalancerStablePool} from "../../interfaces/balancer/IBalancerStablePool.sol"; import {IBalancerWeightedPool} from "../../interfaces/balancer/IBalancerWeightedPool.sol"; @@ -651,6 +653,36 @@ contract PriceFeedDeployer is Test, PriceFeedDataLive { } } + // PENDLE PT PRICE FEEDS + PendlePriceFeedData[] memory pendlePTPriceFeeds = pendlePriceFeedsByNetwork[chainId]; + len = pendlePTPriceFeeds.length; + unchecked { + for (uint256 i; i < len; ++i) { + Tokens t = pendlePTPriceFeeds[i].token; + address token = tokenTestSuite.addressOf(t); + + if (token == address(0)) { + continue; + } + + address underlying = tokenTestSuite.addressOf(pendlePTPriceFeeds[i].underlying); + + address pf = address( + new PendleTWAPPTPriceFeed( + pendlePTPriceFeeds[i].market, + priceFeeds[underlying], + stalenessPeriods[underlying], + pendlePTPriceFeeds[i].twapWindow + ) + ); + + setPriceFeed(token, pf, pendlePTPriceFeeds[i].reserve); + + string memory description = string(abi.encodePacked("PRICEFEED_", tokenTestSuite.symbols(t))); + vm.label(pf, description); + } + } + priceFeedConfigLength = priceFeedConfig.length; priceFeedConfigReserveLength = priceFeedConfigReserve.length; }