goat-systems / tzpay Goto Github PK
View Code? Open in Web Editor NEWtzpay is a configurable batch payment tool for Bakers in the Tezos ecosystem
License: MIT License
tzpay is a configurable batch payment tool for Bakers in the Tezos ecosystem
License: MIT License
Hi,
I've successfully send one payout, them with the next one got this error:
Counter 866835 already used for contract tz1XXXXXXXXXXXXX (expected 866836)
Currently the reporting creates a csv showing which address received what:
KT1WvyJ1qUrWzShA2T6QeL7AW4DR6GspUimM,0.024563
KT1Veiiv3NvVF4YpZmSjUaJP7hhKqda4LX4A,0.506465
KT1VBXqcStE2sonpWSFTRurzVgdtAPT5HdEU,2.532329
Expand this to include gross pay, net pay, fee, and fiat value. Also include how much the delegate's address made from their personal stake, along with how much they made from their fee.
I am trying to execute the payout
subcommand by running:
./payman payout --delegate=tz3NdTPb3Ax2rVW2Kq9QEdzfYFkRwhrQRPhX --cycle=190 --node=https://alphanet.tezrpc.me --fee=0.1 --payout-min=10000 --secret=<edesk...> --password=<password> --network-fee=1420
However, I'm getting this error:
payout.go:133: could not create batch payment: failed to Pre-Apply: could not preapply operation: bad response code 500
I am able to generate a report with the report
subcommand without issue. However, I am getting this error when running the payout
subcommand on both Alphanet
and Mainnet
.
I've tracked down the error to this line in go-tezos
. It seems that validation fails when comparing the batch payment generated by go-tezos
against the node. It appears to also relate to this go-tezos
issue.
Delegate
, secret
are a bit confusing in the current description:
We should modify delegate
to bakerAddress
so it's very clear that it's the baker's address and not the payout's wallet. Also, the fact that there is no need to specify the Payout Wallet Public Key because of passing the PK should be made clear to the user by using secretPayoutWallet
.
Naming proposal:
i). bakerAddress
: Baker's address, the node that is running the Tezos Bakery.
ii). delegators
: the different addresses that are delegating to the Baker's address.
iii). payoutWallet
& secretPayoutWallet
: the wallet that is sending payouts to delegator addresses. We can use secretPayoutWallet
for "encrypted secret key of the wallet paying (e.g. --secret=)"
To look have something like that:
./payman payout \
--bakerAddress=tz3gN8NTLNLJg5KRsUU47NHNVHbdhcFXjjaB \
--secretPayoutWallet=edesk1Qx5JbctVnFVHL4A7BXgyExihHfcAHRYXoxkbSBmKqP2Sp92Gg1xcU8mqqu4Qi9TXkXwomMxAfy19sWAgCm \
--password=abcd1234 \
--cycle=160 \
--node=127.0.0.1 \
--port=8732 \
--fee=0.05
Many bakers choose to only payout delegators who have accrued reward that exceeds a predefined minimum payout. Currently this is not possible with Payman (without manually providing the overwritten payouts JSON).
I am running the following:
$ payman report --delegate=tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt --cycle=101 --node=https://mainnet-node.tzscan.io:443 --fee=0.1
I get the follow errors:
2019/05/18 02:06:28 report.go:65: could not get delegate report for
tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt at cycle 101: could not get rewards for
tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt at 101 cycle: bad response code 404
I can't find a work-around for the 404
error. I've also tried with a local endpoint (http://127.0.0.1:8732
), however this does not help. I am currently running on MacOS. Any idea why this is failing?
Use the calculations from the dry run to construct the command needed to execute a payout manually with the tezos-client.
If I call the report
subcommand for cycle 103
:
./payman report --delegate=tz1Z3KCf8CLGAYfvVWPEr562jDDyWkwNF7sT --cycle=103 --node=https://mainnet.tezrpc.me --fee=0.1 --payout-min=10000
One of the values I receive in the report is the following:
+--------------------------------------+-----------+------------+-----------+------------+
| ADDRESS | SHARE | GROSS | FEE | NET |
+--------------------------------------+-----------+------------+-----------+------------+
| KT1SZW1BpgPibbiRc9aqtqXeKKh4fe56XyZB | 1.571122 | 2.592351 | 0.259235 | 2.333116 |
...
This suggests that for delegator KT1SZW1BpgPibbiRc9aqtqXeKKh4fe56XyZB
the following are the calculated values for cycle 103
:
Gross Payout: 2.592351 ꜩ
Net Payout: 2.333116 ꜩ
However, if you call the TzScan API as follows:
http://api6.tzscan.io/v1/rewards_split/tz1Z3KCf8CLGAYfvVWPEr562jDDyWkwNF7sT?cycle=103&p=0
You will get the following values:
{
"delegate_staking_balance":"210040925181",
"delegators_nb":29,
"delegators_balance":[
[
{
"tz":"KT1SZW1BpgPibbiRc9aqtqXeKKh4fe56XyZB"
},
"3300000000"
],
...
],
"blocks_rewards":80000000,
"endorsements_rewards":85000000,
"fees":12293,
"future_blocks_rewards":0,
"future_endorsements_rewards":0,
"gain_from_denounciation":0,
"lost_deposit_from_denounciation":0,
"lost_rewards_denounciation":0,
"lost_fees_denounciation":0,
"revelation_rewards":0,
"lost_revelation_rewards":0,
"lost_revelation_fees":0
}
As we can see, this delegator should receive the following percentage of all rewards and fees:
3300000000 / 210040925181 = 0.01571122388 = %1.571122388
We can also see that the total rewards and fees accrued by the baker for this round are as follows:
80000000 + 85000000 + 12293 = 165012293
Finally, we can calculate that the gross payout for this delegator should be as follows:
0.01571122388 * 165012293 = 2592545.07827516
And by removing the bakers fee (10%), we get:
2592545.07827516 * 0.9 = 233329057044764.4
Finally, by switching back to XTZ and rounding to 6 decimal places, we get:
Gross Payout: 2.592545 ꜩ
Net Payout: 2.333291 ꜩ
Thus, we can see that there is a small discrepancy between the payouts that Payman is calculating and the values we manually calculated (0.000194
ꜩ discrepancy for the Gross Payout, or 0.000175
ꜩ of the Net Payout). Additionally, we can see that Baking Bad also shows an expected payout of 2.333291
ꜩ:
This payout discrepancy bug is present in all entries returned by a report.
Hi,
Thanks for your great work ! I understand that what your program already does is much more sophisticated that what I am going to request but if possible, please consider it.
We already have programs that calculate each delegates share and store it in our database for reporting purposes and etc but as you know tezos-client is unable to send batch payments.
So we have to send payments one by one which is inefficient and takes a few hours to complete.
Can you add the option to get the delegates addresses and payment amounts from command line and send it in one batch payment ?
You may ask why not let the payman calculate everything and send the payment, the reason is that we have specific policies which are not the same for all delegates and payman can not calculate the rewards based on our policies.
Regards
I tried payman on my irontez node and got this error :
$ payman report --delegate=tz1PeZx7FXy7QRuMREGXGxeipb24RsMMzUNe --cycle=96 --node=127.0.0.1 --port=8732 --fee=0.05
2019/05/02 17:25:58 Could not get unMarshal bytes into block: unexpected end of JSON input
2019/05/02 17:25:58 Could not get unMarshal bytes into block: unexpected end of JSON input
2019/05/02 17:25:58 report.go:63: unexpected end of JSON input
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.