Skip to content

custom unstake algo#20

Merged
nope-finance merged 4 commits intomainfrom
custom_unstake
Jun 3, 2025
Merged

custom unstake algo#20
nope-finance merged 4 commits intomainfrom
custom_unstake

Conversation

@0xripleys
Copy link
Contributor

@0xripleys 0xripleys commented Mar 18, 2025

Allow each hook to define a custom unstaking algorithm. This way, different LSTs can have different unstaking behaviour.

Note that unstaking via liquid_staking::redeem will still work, however the admin can set different fees on the two unstaking flows to incentivize what they want.

Default unstaking flow (which still works!):

let sui = liquid_staking::redeem(&mut system_stat, liquid_staking_info, lst, scenario.ctx());

New custom unstaking flow

let custom_redeem_request = lst_info.custom_redeem_request(lst_to_unstake,&mut system_state, scenario.ctx());
weight_hook.handle_custom_redeem_request(&mut system_state, &mut lst_info, &custom_redeem_request, scenario.ctx());
let sui = lst_info.custom_redeem(custom_redeem_request, &mut system_state, scenario.ctx());

@nope-finance nope-finance merged commit 3a9384c into main Jun 3, 2025
1 check passed
@nope-finance nope-finance deleted the custom_unstake branch June 3, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants