AstarNetwork / astar-frame

Core frame modules for Astar & Shiden network.
Other
58 stars 38 forks source link

Question about rewardDestination state(auto stake). #160

Open johnnyji-dev opened 1 year ago

johnnyji-dev commented 1 year ago

Hi~ I'm developing for astar staking service. I have a Question about rewardDestination state(auto stake).

===== What I am saying the rewardDestination like below. I wanna know that how to change state value about rewardDestination ( "StakedBalance"={"ON"} or "FreeBalance"={"OFF"} on {endpoint=this.client}.query.dappsStaking.ledger(staker); ) or Re-Stake After Claiming ( "ON"={"StakedBalance"} or "OFF"={"FreeBalance"} on https://portal.astar.network/shibuya-testnet/dapp-staking/discover).

===== Q1) Which condition can make it change from "ON" to "OFF" or "OFF" to "ON" automatically not sending transaction[dappsstaking (set_reward_destination)]?

===== Sharing Test Result) For example, "A" wallet is on 6.xxSBY(available), 0SBY(staking), 3.xxxSBY(unstaking and unbonded), "FreeBalance"={"OFF"}. So, I sent [dappsstaking (withdraw_unbonded)] transaction that unbonded 3.xxxSBY. And I withdrew 3SBY from "A" to "B".

I expected that the "A" wallet is on 6.xxxSBY(available), 0SBY(staking), 0SBY(unstaking and unbonded), "FreeBalance"={"OFF"}. But "FreeBalance"={"OFF"} is changed to "StakedBalance"={"ON"} automatically. On subscan.io, "A" wallet has no transaction[dappsstaking (set_reward_destination)] for changing rewardDestination.

Kahonnohak commented 1 year ago

Thank you for reporting @johnnyji-dev !

@impelcrypto please take a look.

johnnyji-dev commented 1 year ago

Thank you for reporting @johnnyji-dev !

@impelcrypto please take a look.

Additional Test) Wallet-State) 0.xxxSBY Available 10SBY Staking 5SBY Unstaking "FreeBalance"={"OFF"} After 2era, unbonded.

I sent [dappsstaking (withdraw_unbonded)] transaction that unbonded 5SBY.

The result is that 10SBY Staking | 0SBY Unstaking | 4.xxSBY(available) | "FreeBalance"={"OFF"}. "FreeBalance"={"OFF"} state was not changed.

Reviewing my test cases, RewardDestination state(auto stake) is automatically changed "FreeBalance"={"OFF"} to "StakedBalance"={"ON"} on below cases.

  1. when creating a new wallet
  2. when staking states(staking value=0 | unstaking value=0 | unbonding value=0) being zero-value.

Is there any other cases that rewardDestination state(auto stake) automatically is changed?

Kahonnohak commented 1 year ago

Thanks, for this particular thing - as we are working on remodelling dApp Staking, this will change. We might not have a re-stake feature, we might keep it, but we have not made a decision yet.

dApp Staking new functions will be clearer in a couple of months but do let me know if you would still like to know the current status.

Thank you!