Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions contracts/oracle/LPOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ contract LPOracle {
price = (sqrtK * 2 * sqrt(uint256(px0 * px1))) / 1e18;
}

/// @notice Gets the latest price of the liquidity pool token.
function latestAnswer() public view returns (int256) {
return int256(getPrice());
}

/// @notice Computes the square root of a given number using the Babylonian method.
/// @dev This function uses an iterative method to compute the square root of a number.
/// @param x The number to compute the square root of.
Expand Down
6 changes: 3 additions & 3 deletions deploy/deploy-oracleLP.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";

const NILE_AMM = "0x0040F36784dDA0821E74BA67f86E084D70d67a3A";
const ZERO_PRICE_FEED = "0x130cc6e0301B58ab46504fb6F83BEE97Eb733054";
const ETH_PRICE_FEED = "0x3c6Cd9Cc7c7a4c2Cf5a82734CD249D7D593354dA";
const NILE_AMM = "0x6cDcb1C4A4D1C3C6d054b27AC5B77e89eAFb971d";
const ZERO_PRICE_FEED = "0x15Fc7b4982A11c5CB63379cD0b2CE57f3e9C08f9";
const ETH_PRICE_FEED = "0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70";

async function main(hre: HardhatRuntimeEnvironment) {
const { deployments, getNamedAccounts } = hre;
Expand Down
1 change: 1 addition & 0 deletions deployments/base/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8453
Loading