question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calculate transaction costs with address weight in mind

See original GitHub issue

The option to always add the transaction fee to the invoice should help cover the fees involved in sending the collected funds to an exchange and therefore it would make sense to calculate the amount of fees dependant on the kind of address that the money was sent to (legacy/p2sh/native segwit). However from my test it seems to always calculate the fees based on an kind of optimal case. For example I did two payments in a row: native segwit and legacy and both times it calculated: 0.000039 BTC in fees. I twould have expected to see higher fees for the legacy payment target as it costs more to retrieve those funds.

@kukks added in Mattermost: […]The ocde currently assumes each tx is 100 bytes from the looks of it and ignores address weight onchainMethod.NextNetworkFee = onchainMethod.FeeRate.GetFee(100); // assume price for 100 bytes

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Kukkscommented, Apr 25, 2019

How about a simple solution:

We allow you to enter the network fee yourself on the store level. If blank, it defaults to the current implementation. ᐧ

On Wed, Apr 24, 2019 at 7:51 PM Markus Petzsch notifications@github.com wrote:

It can always just be an estimate anyway, as no-one knows where fees will actually be at at the time the wallet of a store is being transferred.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/btcpayserver/btcpayserver/issues/782#issuecomment-486358257, or mute the thread https://github.com/notifications/unsubscribe-auth/AAN357ULNF7HEW2XDHZWRC3PSCM3NANCNFSM4HHY5TQA .

0reactions
pavlenexcommented, Jun 17, 2021

Aye, closing this one then, since there hasn’t been much interest/consensus. Let’s re-open if we see the need. Thanks for helping with the cleanup @bolatovumar and @petzsch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Portfolio Weight: Meaning, Calculations, and Examples
Portfolio weight is the percentage each holding comprises in an investment portfolio. Together, these holdings make up a strategy for diversification.
Read more >
Disclosing Transaction Costs –
In the context of fund cost disclosures, it is not always straightforward to determine the most appropriate benchmark due to differences in the...
Read more >
Trading Costs
First, the trading costs we estimate are independent of the strategy generating the trades. The trading algorithm takes the desired portfolio weights as ......
Read more >
The Transaction Cost Approach
The transaction cost approach to the study of economic organization regards the transaction as the basic unit of analysis and holds that an...
Read more >
Predicting Market Impact Costs Using Nonparametric ...
In this section, we describe the proposed procedure to calculate the market impact cost by using nonparametric machine learning models with an ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found