You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
15. Check interest amount in range for both positions.
4378
+
15. Check interest amount in range for all the positions.
4262
4379
4263
4380
**Logic:**
4264
4381
@@ -4269,7 +4386,7 @@ Only the Operator can execute.
4269
4386
5. call the new redeem function of the vault contract (a version where the price of a vault share is dicateded by the operator) which burns the vault shares and transfers the assets from the vault contract to the perps contract
4270
4387
6. increase the position_id collateral_id balance by vault_share_execution_price*number_of_shares
4271
4388
7. reduce the vault_position_id collateral_id balance by vault_share_execution_price*number_of_shares
4272
-
8. Add interest amounts to collateral balances for both positions, including timestamp.
4389
+
8. Add interest amounts to collateral balances for all the positions, including timestamp.
4273
4390
4274
4391
**Emits:**
4275
4392
@@ -4289,6 +4406,9 @@ fn liquidate_vault_shares(
4289
4406
liquidated_asset_id:AssetId,
4290
4407
actual_shares_user:i64,
4291
4408
actual_collateral_user:i64,
4409
+
redeeming_interest_amount:i64,
4410
+
receiving_interest_amount:i64,
4411
+
vault_interest_amount:i64,
4292
4412
);
4293
4413
```
4294
4414
@@ -4314,17 +4434,19 @@ Only the Operator can execute.
4314
4434
10. position id is liquidatable.
4315
4435
11. vault_share_execution_price is non zero.
4316
4436
12. Caller is the operator.
4437
+
13. Check interest amounts in range for all the positions.
4317
4438
4318
4439
**Logic:**
4319
4440
4320
4441
1. Run validations
4321
-
2. transfer vault_asset_id: number_of_shares from the perps contract to the vault contract (for burning the vault shares)
4322
-
3. reduce the position id vault share balance by number_of_shares
4323
-
4. transfer collateral_id: vault_share_execution_price*number_of_shares from the perps contract to the vault contract (for transferring back the shares value)
4324
-
5. call the new redeem function of the vault contract (a version where the price of a vault share is dicateded by the operator) which burns the vault shares and transfers the assets from the vault contract to the perps contract
4325
-
6. increase the position_id collateral_id balance by vault_share_execution_price*number_of_shares
4326
-
7. reduce the vault_position_id collateral_id balance by vault_share_execution_price*number_of_shares
4327
-
8. position id is healthier
4442
+
2. Add interest amounts for all the positions, and update timestamps.
4443
+
3. transfer vault_asset_id: number_of_shares from the perps contract to the vault contract (for burning the vault shares)
4444
+
4. reduce the position id vault share balance by number_of_shares
4445
+
5. transfer collateral_id: vault_share_execution_price*number_of_shares from the perps contract to the vault contract (for transferring back the shares value)
4446
+
6. call the new redeem function of the vault contract (a version where the price of a vault share is dicateded by the operator) which burns the vault shares and transfers the assets from the vault contract to the perps contract
4447
+
7. increase the position_id collateral_id balance by vault_share_execution_price*number_of_shares
4448
+
8. reduce the vault_position_id collateral_id balance by vault_share_execution_price*number_of_shares
0 commit comments