Shaggy Clay Cobra
High
The contract BondOracleAdapter
returns the wrong price unit, which is not in term of Bond token decimals
The function BondOracleAdapter::latestRoundData()
returns the price x96, not the price in term of Bond token decimals
function latestRoundData()
external
view
returns (uint80, int256, uint256, uint256, uint80){
uint32[] memory secondsAgos = new uint32[](2);
secondsAgos[0] = twapInterval; // from (before)
secondsAgos[1] = 0; // to (now)
(int56[] memory tickCumulatives, ) = ICLPool(dexPool).observe(secondsAgos);
uint160 getSqrtTwapX96 = TickMath.getSqrtRatioAtTick(
int24((tickCumulatives[1] - tickCumulatives[0]) / int56(uint56(twapInterval)))
);
@> return (uint80(0), int256(getPriceX96FromSqrtPriceX96(getSqrtTwapX96)), block.timestamp, block.timestamp, uint80(0));
}
No response
No response
- Assume that the collateral level is currently above the threshold -> a Bond token is priced
BOND_TARGET_PRICE = 100
- Market rate reported from Oracle is 95
- An user redeem BondETH with rate = 100, instead of 95
- Wrong Bond token price will be used in the system
No response
No response