@gearbox-protocol/periphery-v3 1.7.0-next.33 → 1.7.0-next.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -20,6 +20,7 @@ import {BPTWeightedPriceFeedSerializer} from "../serializers/oracles/BPTWeighted
|
|
|
20
20
|
import {LPPriceFeedSerializer} from "../serializers/oracles/LPPriceFeedSerializer.sol";
|
|
21
21
|
import {PythPriceFeedSerializer} from "../serializers/oracles/PythPriceFeedSerializer.sol";
|
|
22
22
|
import {RedstonePriceFeedSerializer} from "../serializers/oracles/RedstonePriceFeedSerializer.sol";
|
|
23
|
+
import {PendleTWAPPTPriceFeedSerializer} from "../serializers/oracles/PendleTWAPPTPriceFeedSerializer.sol";
|
|
23
24
|
import {PriceFeedAnswer, PriceFeedMapEntry, PriceFeedTreeNode, PriceOracleState} from "../types/PriceOracleState.sol";
|
|
24
25
|
|
|
25
26
|
interface ImplementsPriceFeedType {
|
|
@@ -96,6 +97,7 @@ contract PriceFeedCompressor is IPriceFeedCompressor {
|
|
|
96
97
|
_setSerializer("PF_BOUNDED_ORACLE", address(new BoundedPriceFeedSerializer()));
|
|
97
98
|
_setSerializer("PF_PYTH_ORACLE", address(new PythPriceFeedSerializer()));
|
|
98
99
|
_setSerializer("PF_REDSTONE_ORACLE", address(new RedstonePriceFeedSerializer()));
|
|
100
|
+
_setSerializer("PF_PENDLE_PT_TWAP_ORACLE", address(new PendleTWAPPTPriceFeedSerializer()));
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
/// @notice Returns all potentially useful price feeds data for a given price oracle in the form of two arrays:
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Gearbox Protocol. Generalized leverage for DeFi protocols
|
|
3
|
+
// (c) Gearbox Foundation, 2024.
|
|
4
|
+
pragma solidity ^0.8.17;
|
|
5
|
+
|
|
6
|
+
import {PendleTWAPPTPriceFeed} from "@gearbox-protocol/oracles-v3/contracts/oracles/pendle/PendleTWAPPTPriceFeed.sol";
|
|
7
|
+
import {IStateSerializerLegacy} from "../../interfaces/IStateSerializerLegacy.sol";
|
|
8
|
+
|
|
9
|
+
contract PendleTWAPPTPriceFeedSerializer is IStateSerializerLegacy {
|
|
10
|
+
function serialize(address priceFeed) external view override returns (bytes memory) {
|
|
11
|
+
PendleTWAPPTPriceFeed pf = PendleTWAPPTPriceFeed(priceFeed);
|
|
12
|
+
|
|
13
|
+
return abi.encode(pf.market(), pf.sy(), pf.yt(), pf.expiry(), pf.twapWindow(), pf.priceToSy());
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
CHANGED