Skip to content

Commit

Permalink
fix: add missing pendle price feed test deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Van0k committed Sep 11, 2024
1 parent 62d03a9 commit a14363c
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion contracts/test/suites/PriceFeedDeployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a14363c

Please sign in to comment.