-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
These test don't apply anymore since Uniswap feed were removed.
v1-core/tests/markets/test_oi_cap.py
Lines 8 to 36 in ad3d152
| def test_cap_notional_front_run_bound(market, feed): | |
| idx = RiskParameter.LMBDA.value | |
| lmbda = Decimal(market.params(idx)) / Decimal(1e18) | |
| data = feed.latest() | |
| # NOTE: assumes using UniswapV3 feed with hasReserve = true | |
| _, _, _, _, _, _, reserve_micro, _ = data | |
| # check front run bound is lmbda * reserveOverMicro when has reserve | |
| expect = int(lmbda * Decimal(reserve_micro)) | |
| actual = market.frontRunBound(data) | |
| assert int(actual) == approx(expect) | |
| def test_cap_notional_back_run_bound(market, feed): | |
| idx = RiskParameter.DELTA.value | |
| delta = Decimal(market.params(idx)) / Decimal(1e18) | |
| data = feed.latest() | |
| # NOTE: assumes using UniswapV3 feed with hasReserve = true | |
| average_block_time = market.params(RiskParameter.AVERAGE_BLOCK_TIME.value) | |
| _, _, macro_window, _, _, _, reserve_micro, _ = data | |
| # check back run bound is macroWindowInBlocks * reserveInOvl * 2 * delta | |
| # when has reserve | |
| window = Decimal(macro_window) / Decimal(average_block_time) | |
| expect = int(Decimal(2) * delta * Decimal(reserve_micro) * window) | |
| actual = market.backRunBound(data) | |
| assert int(actual) == approx(expect) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels