jito-foundation / restaking

https://docs.restaking.jito.network/
Other
54 stars 5 forks source link

VAULT: Withdrawal slippage PT1 #121

Open coachchucksol opened 1 week ago

coachchucksol commented 1 week ago

The time between enqueuing withdrawal and burning a slashing event can happen. This would result in an unfavorable slippage. While this is the result of slashing, the depositor should be able to decide how much slippage they are willing to incur and make an informed decision if the slippage exceeds what they are expecting.

The first part of this solution is to allow the depositor to set the min_amount_out when calling enqueue_withdrawal.

Outline of proposed final solution

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 88.82353% with 19 lines in your changes missing coverage. Please review.

Project coverage is 82.18%. Comparing base (4af6d94) to head (c3b714b).

Files with missing lines Patch % Lines
vault_core/src/vault.rs 90.97% 12 Missing :warning:
vault_core/src/vault_staker_withdrawal_ticket.rs 54.54% 5 Missing :warning:
vault_program/src/burn_withdrawal_ticket.rs 77.77% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #121 +/- ## ========================================== - Coverage 82.29% 82.18% -0.11% ========================================== Files 86 86 Lines 8651 8790 +139 ========================================== + Hits 7119 7224 +105 - Misses 1532 1566 +34 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.