Skip to content

Commit

Permalink
Merge pull request #244 from VenusProtocol/feat/btc-pool
Browse files Browse the repository at this point in the history
[VEN-2943]: Add oracles for PT-SolvBTC.BBN-27MAR2025
  • Loading branch information
chechu authored Dec 30, 2024
2 parents c202988 + 7fdbfcd commit 02a386b
Show file tree
Hide file tree
Showing 24 changed files with 8,873 additions and 2,538 deletions.
61 changes: 61 additions & 0 deletions deploy/16-deploy-SolvBTC.BBN-pendle-oracles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { ethers } from "hardhat";
import { DeployFunction } from "hardhat-deploy/dist/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { ADDRESSES } from "../helpers/deploymentConfig";

enum PendleRateKind {
PT_TO_ASSET = 0,
PT_TO_SY = 1,
}

const func: DeployFunction = async ({ getNamedAccounts, deployments, network }: HardhatRuntimeEnvironment) => {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();

const oracle = await ethers.getContract("ResilientOracle");
const proxyOwnerAddress = network.live ? ADDRESSES[network.name].timelock : deployer;
const redStoneOracle = await ethers.getContract("RedStoneOracle");
const resilientOracle = await ethers.getContract("ResilientOracle");
const addresses = ADDRESSES[network.name];
const ptOracleAddress = addresses.PTOracle || (await ethers.getContract("MockPendlePtOracle")).address;

await deploy("SolvBTC.BBN_OneJumpRedStoneOracle", {
contract: "OneJumpOracle",
from: deployer,
log: true,
deterministicDeployment: false,
args: [addresses["SolvBTC.BBN"], addresses.BTCB, resilientOracle.address, redStoneOracle.address],
proxy: {
owner: proxyOwnerAddress,
proxyContract: "OptimizedTransparentProxy",
},
skipIfAlreadyDeployed: true,
});

await deploy("PendleOracle-PT-SolvBTC.BBN-27MAR2025", {
contract: "PendleOracle",
from: deployer,
log: true,
deterministicDeployment: false,
args: [
addresses["PT-SolvBTC.BBN-27MAR2025_Market"] || "0x0000000000000000000000000000000000000001",
ptOracleAddress,
PendleRateKind.PT_TO_SY,
addresses["PT-SolvBTC.BBN-27MAR2025"],
addresses["SolvBTC.BBN"],
oracle.address,
900,
],
proxy: {
owner: proxyOwnerAddress,
proxyContract: "OptimizedTransparentUpgradeableProxy",
},
skipIfAlreadyDeployed: true,
});
};

export default func;
func.tags = ["PT-SolvBTC.BBN"];
func.skip = async (hre: HardhatRuntimeEnvironment) =>
hre.network.name !== "bsctestnet" && hre.network.name !== "bscmainnet";
5 changes: 3 additions & 2 deletions deploy/7-dependencies-pendle-oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ const func: DeployFunction = async ({ getNamedAccounts, deployments, network }:
};

export default func;
func.tags = ["pendle"];
func.skip = async (hre: HardhatRuntimeEnvironment) => hre.network.name !== "sepolia";
func.tags = ["pendle", "mock-pt-oracle"];
func.skip = async (hre: HardhatRuntimeEnvironment) =>
hre.network.name !== "sepolia" && hre.network.name !== "bsctestnet";
Loading

0 comments on commit 02a386b

Please sign in to comment.