Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove owners #712

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Remove owners #712

wants to merge 2 commits into from

Conversation

nicolasochem
Copy link
Contributor

TRD has the concept of "owners" where several tez holders can pool their tez in one bakery. TRD would then distribute rewards amongst them. The problem is, since Paris upgrade, rewards are split in two, delegated and staking rewards. For a baker, it makes sense to stake most tez, to increase staking & delegation capability. But then, rewards are staked (frozen) and TRD can not distribute them.

We are therefore removing the concept of "bakery owners" since it conflicts with the concept of staker and can lead to false expectations. In fact, it confused quite a few bakers during paris rollout.

We are leaving the concept of "founders" since the goal is to distribute the delegation fees to different accounts. This still makes sense as delegation fees are unfrozen and can be distributed. I would have preferred to remove it as well: indeed, staking does not have this capability, so why would TRD have it? However, after few people mentioned on slack that it is useful to them, I am leaving it.

owners_parent remains for now, but should be sed'd away to just "owners"
next
@vchong
Copy link

vchong commented Jul 26, 2024

Thank you for leaving the founders intact! It's really still useful for many of us!

Now, wrt to owners, we found that with release v13.0, the owners are still getting paid. We assumed this was due to the unstaked balance in the baker account. Please correct us if this is a wrong assumption!

E.g.

owners_map: {
    "tz1abcd1pK9h2BVGXdyvfQSv8kd1LQM6H889": 0.5
    ...
}

calculations/748.csv

address type delegated_balance current_balance ratio fee_ratio amount fee_amount fee_rate overestimate adjustment adjusted_amount delegate_transaction_fee delegator_transaction_fee payable skipped atphase desc payment_address rewards_type            
tz1abcd1pK9h2BVGXdyvfQSv8kd1LQM6H889 O 55731087976 508421945340 0.0404297998 0 26770856 0 0 0 0 26770856 298 0 1 0 -1   tz1boot1pK9h2BVGXdyvfQSv8kd1LQM6H889 A            

payments/748.csv

address type amount hash paid description
tz1abcd1pK9h2BVGXdyvfQSv8kd1LQM6H889 O 26770856 paid

Our concern is, with this PR, will payments like the above go away? If they do go away, then wouldn't delegated rewards for the unstaked balance in the baker be left unpaid?

@nicolasochem
Copy link
Contributor Author

Our concern is, with this PR, will payments like the above go away? If they do go away, then wouldn't delegated rewards for the unstaked balance in the baker be left unpaid?

@vchong yes, you are correct. Owners still get the delegation rewards for the unstaked balace of the baker.

My point is:

  • bakers should really not have an unstaked balance above 1 tez to pay for operation fees. delegated balance earns less than staking.
  • it is really confusing for "owners" that their delegated rewards are paid out by TRD and their staked rewards are paid manually by the bakery operator.

I understand that the baker may have unstaked balance because they want to hold on to liquid tez to potentially sell them at short notice. Still, since the operator is making calculations to distribute staking rewards for all the bakery stakeholders, they can as well do manual delegation reward distribution.

My goal is primarily to remove some code to make the project easier to maintain. But if you are telling me that "owners" feature is still useful, I have no problem keeping it and closing this PR.

@ericlavoie ericlavoie closed this Jul 26, 2024
@nicolasochem nicolasochem reopened this Jul 27, 2024
@vchong
Copy link

vchong commented Jul 29, 2024

bakers should really not have an unstaked balance above 1 tez to pay for operation fees

Please correct me if I'm wrong, but how is this possible? The delegated rewards accumulate in the baker address, and the funds there are needed to pay the delegators, so there'll always be unstaked balance in the account, and thus earned delegated rewards.

it is really confusing for "owners" that their delegated rewards are paid out by TRD and their staked rewards are paid manually by the bakery operator

Yes, we agree this seems to be the issue at hand. Currently, we're seeking to explain to the owners changes due to Paris and offer a viable solution. The best option so far seems to be:

  • Leave the staked rewards in the baker account to continue compounding
  • Unstake and distribute all accumulated staked rewards when owners choose to withdraw or whenever there's a change in baker ownership %s

Benefits:

  • No extra manual calculations/transactions every payout cycle
  • Owners continue earning compounded staked rewards at a better rate than delegated rewards

baker may have unstaked balance because they want to hold on to liquid tez to potentially sell them at short notice

This is possible, but as mentioned above, it's rather just for holding the funds needed to pay out delegated rewards.

since the operator is making calculations to distribute staking rewards for all the bakery stakeholders, they can as well do manual delegation reward distribution

Calculations for staked rewards only involve less than a handful of addresses and are relatively much easier than calculations for delegated rewards. I.e. it's just curling the staked rewards of the baker address and dividing them up by the %s in the owners map. Whereas, calculations for delegated rewards involve the need to know the share of all the baker's delegators, which can be in the thousands. Currently, trd is taking care of these calculations for us 🙏🙏🙏, and if we're to do it ourselves by hand, we'd have no idea where to start!

if you are telling me that "owners" feature is still useful, I have no problem keeping it and closing this PR

Yes, due to the reasons mentioned above, we feel that the "owners" feature is still greatly needed and as such, we'd really appreciate it if you can please keep it!

@vchong
Copy link

vchong commented Jul 29, 2024

Referring to https://tezos.gitlab.io/alpha/consensus.html#validator-selection-staked-balance-and-active-stake:
"The spendable balance of a delegate is its full balance minus its staked balance and unstaked frozen balance."

  1. Does "unstaked frozen balance" refers to "TOTAL UNSTAKED" in e.g. https://tzkt.io/tz1eEnQhbwf6trb8Q8mPb2RaPkNk2rN7BKi8 and "Unstaked Balance" in e.g. https://tzstats.com/tz1eEnQhbwf6trb8Q8mPb2RaPkNk2rN7BKi8?

Screenshot from 2024-07-29 17-35-33
Screenshot from 2024-07-29 17-35-44

  1. Do both "spendable balance" and "unstaked frozen balance" earn delegated rewards?

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.

3 participants