Skip to content

Fix release schedule percentages and miner fee estimate in Avalonia invest view#681

Merged
dangershony merged 2 commits intomainfrom
copilot/fix-release-schedule-percentage
Mar 4, 2026
Merged

Fix release schedule percentages and miner fee estimate in Avalonia invest view#681
dangershony merged 2 commits intomainfrom
copilot/fix-release-schedule-percentage

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Two display bugs in the Avalonia investor flow: stage release percentages rendered as 1000%/3000% instead of 10%/30%, and miner fee always showed 0.

Percentage fix — DocumentProjectService.cs

AmountToRelease is stored as a whole percentage (e.g. 10 = 10%). ProjectService already divided by 100 when mapping to RatioOfTotal; DocumentProjectService did not, so the p0 StringFormat (×100) produced 1000%:

// Before
RatioOfTotal = stage.AmountToRelease

// After
RatioOfTotal = stage.AmountToRelease / 100m

Miner fee estimate — InvestViewModel.cs

GetTransactionDetails hardcoded new AmountUI(0) for miner fee. It now estimates based on transaction virtual size (overhead + 1 P2WPKH input + stage outputs + change) at 1 sat/vbyte, using the stage count from the selected pattern (Fund/Subscribe) or static project stages (Invest):

int estimatedVSize = txOverhead + inputSize + (stageCount + 2) * outputSize;
long minerFeeSats = estimatedVSize * defaultFeeRateSatsPerVByte;

Details is also combined with SelectedPattern so the estimate updates reactively when the user switches funding patterns.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: /usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: dangershony <7487930+dangershony@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix release schedule percentages and miner fees display Fix release schedule percentages and miner fee estimate in Avalonia invest view Mar 4, 2026
@dangershony dangershony marked this pull request as ready for review March 4, 2026 19:27
@dangershony dangershony merged commit 74ffe25 into main Mar 4, 2026
3 checks passed
@dangershony dangershony deleted the copilot/fix-release-schedule-percentage branch March 4, 2026 19:34
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.

2 participants