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

Consider using a more realistic fee rate (not fixed 20 sats/vB) to calculate depositor fee #1698

Closed
Tracked by #1683
ws4charlie opened this issue Feb 2, 2024 · 0 comments · Fixed by #1747
Closed
Tracked by #1683
Assignees
Labels
c:bitcoin Bitcoin chain related zetaclient Issues related to ZetaClient

Comments

@ws4charlie
Copy link
Contributor

from Panruo:
our current bitocin accounting is a bit off--TSS will be running deficit
reason is for each outbound btc tx, both depositor and withdrawal pay ZRC20 btc for gas fee.
The depositor pays 20sats/vB, withdrawer pays the 2x current price (96sats right now).
The TSS pays 2x current price for the whole vB (inputs + output)
for a 10inputs + 3outputs typical tx, TSS is losing money, as TSS pays 2x current priced for all inputs while depositors only pay 20sats/vb

from Charlie:
The withdrawer fee is fixed and charged as 254vB * watchedGasPrice in zetacore
The depositor fee is also fixed as 68vB * 20sats/vB per deposit.

For each N-input-3-output outbound transaction:
withdrawer pays 254vB * watchedGasPrice
depositors pays 68vB * (N-1) * 20sat/vB
tss signer pays txSizeVb * watchedGasPrice

When watchedGasPrice > 20sat/vB
tss signer lose: (txSizeVb - 254 - 68*(N-1)) * (watchedGasPrice - 20sat/vB)

@ws4charlie ws4charlie self-assigned this Feb 2, 2024
@lumtis lumtis added the zetaclient Issues related to ZetaClient label Feb 2, 2024
@brewmaster012 brewmaster012 mentioned this issue Feb 2, 2024
@lumtis lumtis added the c:bitcoin Bitcoin chain related label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:bitcoin Bitcoin chain related zetaclient Issues related to ZetaClient
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@lumtis @ws4charlie and others