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.
4383
+
15. Check interest amount in range for all the positions.
4262
4384
4263
4385
**Logic:**
4264
4386
@@ -4269,7 +4391,7 @@ Only the Operator can execute.
4269
4391
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
4392
6. increase the position_id collateral_id balance by vault_share_execution_price*number_of_shares
4271
4393
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.
4394
+
8. Add interest amounts to collateral balances for all the positions, including timestamp.
4273
4395
4274
4396
**Emits:**
4275
4397
@@ -4289,6 +4411,8 @@ fn liquidate_vault_shares(
4289
4411
liquidated_asset_id:AssetId,
4290
4412
actual_shares_user:i64,
4291
4413
actual_collateral_user:i64,
4414
+
liquidated_interest_amount:i64,
4415
+
vault_interest_amount:i64,
4292
4416
);
4293
4417
```
4294
4418
@@ -4314,17 +4438,19 @@ Only the Operator can execute.
4314
4438
10. position id is liquidatable.
4315
4439
11. vault_share_execution_price is non zero.
4316
4440
12. Caller is the operator.
4441
+
13. Check interest amounts in range for both positions.
4317
4442
4318
4443
**Logic:**
4319
4444
4320
4445
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
4446
+
2. Add interest amounts for both positions, and update timestamps.
4447
+
3. transfer vault_asset_id: number_of_shares from the perps contract to the vault contract (for burning the vault shares)
4448
+
4. reduce the position id vault share balance by number_of_shares
4449
+
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)
4450
+
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
4451
+
7. increase the position_id collateral_id balance by vault_share_execution_price*number_of_shares
4452
+
8. reduce the vault_position_id collateral_id balance by vault_share_execution_price*number_of_shares
0 commit comments