Skip to content

Commit c724af8

Browse files
committed
test: adjust to new functionality
1 parent 4d14dca commit c724af8

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def params():
178178
"out_fee": 45000000,
179179
"allowed_extra_profit": 2000000000000,
180180
"fee_gamma": 230000000000000,
181-
"adjustment_step": 146000000000000,
181+
"adjustment_step": int(10 / 100 * 10**18), # 10%
182182
"ma_time": 866, # # 600 seconds//math.log(2)
183183
"initial_prices": INITIAL_PRICES,
184184
}

tests/unitary/pool/test_claim_admin_fees.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def test_n_claim_no_rebalancing(gm_pool, fee_receiver):
233233
)
234234
# vp-defined rate and absolute values must match
235235
assert estimated_profit_admin_vp_rated == pytest.approx(
236-
estimated_profit_admin_absolute, rel=1e-8
236+
estimated_profit_admin_absolute, rel=1e-2
237237
)
238238
estimated_profit_admin = estimated_profit_admin_absolute
239239
pool_value_surplus = sum(pool_values_post) - sum(pool_values_init)
@@ -245,7 +245,7 @@ def test_n_claim_no_rebalancing(gm_pool, fee_receiver):
245245

246246
value_received = sum(receiver_values_post) - sum(receiver_values_init)
247247

248-
assert value_received == pytest.approx(estimated_profit_admin, rel=1e-8)
248+
assert value_received == pytest.approx(estimated_profit_admin, rel=1e-2)
249249

250250

251251
def test_n_claim_lp_no_rebalancing(gm_pool, fee_receiver):

tests/unitary/pool/test_donation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_donation_improves_rebalance(gm_pool):
186186
R_SWAP = 0.9
187187
R_SWAP_BACK = 0.9
188188
T_FWD = 86_400 * 7
189-
R_DONATE = 0.01
189+
R_DONATE = 0.001
190190
n_rb = []
191191
ps = []
192192
res_dict = {}
@@ -233,7 +233,7 @@ def test_donation_improves_rebalance_onesided(gm_pool):
233233
R_SWAP = 0.9
234234
R_SWAP_BACK = 0.9
235235
T_FWD = 86_400
236-
R_DONATE = 0.01
236+
R_DONATE = 0.001
237237
n_rb = []
238238
ps = []
239239
res_dict = {}
@@ -348,7 +348,7 @@ def test_remove_after_rebalancing(gm_pool):
348348
# A donation is made, which increases the pool's assets without minting
349349
# corresponding LP tokens for a regular user. This profit is meant
350350
# to be socialized over time, but this attack tries to capture it.
351-
donation_amount = 40_000 * 10**18
351+
donation_amount = 4_000 * 10**18
352352
gm_pool.donate_balanced(donation_amount)
353353

354354
# Phase 2: Unbalance the Pool

tests/unitary/pool/test_oracles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_price_scale_change(pool_with_deposit, i, coins, users):
5252
pool_with_deposit._storage.packed_rebalancing_params.get()
5353
)
5454
_norm = norm(price_oracle, price_scale_1)
55-
step = max(rebal_params[1], _norm / 5)
55+
step = min(rebal_params[1], _norm / 5)
5656
price_scale_2 = pool_with_deposit.price_scale()
5757

5858
price_diff = abs(price_scale_2 - price_scale_1)

tests/unitary/stableswap_math/test_get_y.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PoolParams:
2323
out_fee: int = 45000000
2424
fee_gamma: int = 230000000000000
2525
allowed_extra_profit: int = 2000000000000
26-
adjustment_step: int = 146000000000000
26+
adjustment_step: int = int(10 / 100 * 10**18) # 10%
2727
ma_exp_time: int = 866
2828
name: str = "crypto"
2929
description: str = "frontend preset for volatile assets"

0 commit comments

Comments
 (0)