parallel icon indicating copy to clipboard operation
parallel copied to clipboard

Cancel unstake improvement

Open 0x8f701 opened this issue 2 years ago • 2 comments

currently it supports only cancel at the same era. We should support cancel at any era

0x8f701 avatar May 29 '22 15:05 0x8f701

Seems like in cancel_unstake, we can easily convert "the DOT amount stored in Unlockings" into sDOT amount, and directly add it to matchingpool.total_stake_amount.free. the steps are following:

    1. decrease DOT amount in Unlockings, just like what rebond does.
    1. calculate sDOT amount according to the current exchange rate, and mint to users
    1. add DOT amount to matchingpool.total_stake_amount.free.

That's all we should do in cancel_unstake. did I miss anything?

mclyk avatar May 30 '22 08:05 mclyk

Option2: User rebond directly via XCM

  1. In Era 1, Alice stake 50, Bob stake 50, matching result is bond 100 on relaychain
  2. In Era 2, Alice stake 100, Bob unstake 50, matching result is bond 50 on relaychain
  3. In Era 3, Bob wants to cancel_unstake 50, if Bob can rebond directly on relaychain, there are no unlocking chunks on relaychain. rebond operation on relaychain will Fail.

This option can not work.

mclyk avatar Aug 11 '22 02:08 mclyk