Skip to content

Commit cb3adc7

Browse files
committed
Reformat using Black
1 parent 2444df8 commit cb3adc7

7 files changed

+13
-9
lines changed

model/parts/fei_capital_allocation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def policy_fei_capital_allocation_endogenous_weight_update(
8484
}
8585
yield_history: List[List] = yield_history_map.values()
8686
yield_map = {
87-
key: max(sum(yield_history) / moving_average_window, 1e-18) or previous_state[key].yield_rate
87+
key: max(sum(yield_history) / moving_average_window, 1e-18)
88+
or previous_state[key].yield_rate
8889
for key, yield_history in yield_history_map.items()
8990
}
9091
yield_vector = np.array(list(yield_map.values()))

model/parts/liquidity_pools.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ def policy_constant_function_market_maker(
9999

100100
# Update User Deposit LP balance
101101
volatile_liquidity_pool_user_deposit.set_balance(
102-
updated_volatile_asset_balance * (1 - protocol_liquidity_share), volatile_asset_price
102+
updated_volatile_asset_balance * (1 - protocol_liquidity_share),
103+
volatile_asset_price,
103104
)
104105
fei_liquidity_pool_user_deposit.set_balance(
105106
updated_fei_balance * (1 - protocol_liquidity_share), fei_price

model/parts/peg_stability_module.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def policy_peg_stability_module(params: Parameters, substep, state_history, prev
6969
abs(mint_redeem_pcv_asset_balance) < active_psm_pcv_deposit.balance
7070
), "Insufficient PCV for redemption"
7171
active_psm_pcv_deposit.withdraw(
72-
amount=abs(mint_redeem_pcv_asset_balance), asset_price=pcv_asset_price
72+
amount=abs(mint_redeem_pcv_asset_balance),
73+
asset_price=pcv_asset_price,
7374
)
7475
# Collect PSM redeem fees
7576
psm_mint_redeem_fees = psm_redeem_fee * abs(fei_minted_redeemed)

model/parts/system_metrics.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ def policy_system_metrics(params, substep, state_history, previous_state):
3131

3232
# NOTE: QUIZ 1
3333
# reserve_ratio = (total_pcv + total_protocol_owned_fei) / total_fei_supply
34-
34+
3535
return {
3636
"stable_backing_ratio": stable_backing_ratio,
3737
"stable_pcv_ratio": stable_pcv_ratio,
3838
"collateralization_ratio": collateralization_ratio,
39-
#"reserve_ratio": reserve_ratio, # NOTE: QUIZ 1
39+
# "reserve_ratio": reserve_ratio, # NOTE: QUIZ 1
4040
"pcv_yield_rate": pcv_yield_rate,
4141
"protocol_equity": protocol_equity,
4242
"protocol_revenue": protocol_revenue,

model/state_update_blocks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"stable_pcv_ratio",
8282
"collateralization_ratio",
8383
# NOTE: Uncomment Below as part of working exercise in Quiz Notebook 1
84-
#"reserve_ratio",
84+
# "reserve_ratio",
8585
"pcv_yield_rate",
8686
# Protocol System Metrics
8787
"protocol_equity",

model/state_variables.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ class StateVariables:
173173
collateralization_ratio: Percentage = Uninitialized
174174
"""The percentage collateralization of the total FEI supply"""
175175
# NOTE: Uncomment Below as part of working exercise in Quiz Notebook 1
176-
#reserve_ratio: Percentage = Uninitialized
177-
#"""The reserve ratio of the Fei Protocol"""
176+
# reserve_ratio: Percentage = Uninitialized
177+
# """The reserve ratio of the Fei Protocol"""
178178
pcv_yield: USD = Uninitialized
179179
"""The per-timestep PCV yield accrued"""
180180
pcv_yield_rate: Percentage = Uninitialized

model/types.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ def transfer(self, to, amount, from_asset_price=None, to_asset_price=None):
145145

146146
self.withdraw(amount, from_asset_price)
147147
to.deposit(
148-
amount * from_asset_price / to_asset_price if to_asset_price else amount, to_asset_price
148+
amount * from_asset_price / to_asset_price if to_asset_price else amount,
149+
to_asset_price,
149150
)
150151

151152
return self, to

0 commit comments

Comments
 (0)