import { ethers } from "ethers" ; import { LpReserveContract } from "../abi" ; import { mimTime } from "../helpers/bond" ; import { Networks } from "../constants/blockchain" ; export async function getMarketPrice ( networkID , provider ) { const mimTimeAddress = mimTime . getAddressForReserve ( networkID ) ; const pairContract = new ethers . Contract ( mimTimeAddress , LpReserveContract , provider ) ; const reserves = await pairContract . getReserves ( ) ; const marketPrice = reserves [ 0 ] / reserves [ 1 ] ; return marketPrice ; }