Skip to content

Commit

Permalink
Removed LiquidityBoundPricing for updated stats
Browse files Browse the repository at this point in the history
  • Loading branch information
tryouge committed Nov 29, 2023
1 parent f6a53db commit ce059d1
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions subgraphs/orbit/src/prices/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,7 @@ export function getLiquidityBoundPrice(

let liquidityBoundPriceUSD = reportedPriceUSD;
if (liquidity > constants.BIGDECIMAL_ZERO && reportedPriceUSD > liquidity) {
liquidityBoundPriceUSD = liquidity
.div(
constants.BIGINT_TEN.pow(
constants.DEFAULT_USDC_DECIMALS as u8
).toBigDecimal()
)
.times(constants.BIGINT_TEN.pow(tokenPrice.decimals as u8).toBigDecimal())
.div(amount);
liquidityBoundPriceUSD = liquidity.div(amount);

log.warning(
"[getLiquidityBoundPrice] token: {} (reported price * amount): ({} * {}) bound to available liquidity: {}; new price: {}",
Expand All @@ -138,12 +131,12 @@ export function getUsdPrice(
const tokenPrice = getUsdPricePerToken(tokenAddr, block);

if (!tokenPrice.reverted) {
if (
tokenPrice.oracleType == constants.OracleType.UNISWAP_FORKS_ROUTER ||
tokenPrice.oracleType == constants.OracleType.CURVE_ROUTER
) {
return getLiquidityBoundPrice(tokenAddr, tokenPrice, amount);
}
// if (
// tokenPrice.oracleType == constants.OracleType.UNISWAP_FORKS_ROUTER ||
// tokenPrice.oracleType == constants.OracleType.CURVE_ROUTER
// ) {
// return getLiquidityBoundPrice(tokenAddr, tokenPrice, amount);
// }
return tokenPrice.usdPrice.times(amount);
}

Expand Down

0 comments on commit ce059d1

Please sign in to comment.