Open jalextowle opened 1 year ago
A concern that came up tonight is that allowing minimum transaction amounts for low decimal tokens like USDC and WBTC can be dangerous because the base paid for shorts can be rounded down with significant dollar amounts.
A concern that came up tonight is that allowing minimum transaction amounts for low decimal tokens like USDC and WBTC can be dangerous because the base paid for shorts can be rounded down with significant dollar amounts.
in ERC4626Validation:test_OpenShortWithShares()
, we test that the realized rate of a short deposit is greater than the market rate prior to the short being opened. I found that this doesn't hold true with non standard decimals. For example,
at 5% fixed rate and the minimum transaction amount of 0.001,
with 18 decimals we have:
shortAmount: 1000000000000000 (0.001e18)
basePaid: 47619051304917
with 6 decimals we have:
shortAmount: 1000 (0.001e6)
basePaid: 47
There is just not enough decimal places of accuracy to make this statement If we make the minimum transaction amount 1e6, then it works great.
We need to write documentation that provides guidance on how potential footguns that deployers and users of Hyperdrive could face in extreme situations. Some important examples are: