Build a volume-weighted Decred ticket-price report

A block with many new tickets should contribute more to a purchase-price report than a block with one ticket. Decred exposes the ticket volume-weighted average for a bounded height interval.

Fix the report's block range

Use a node on the intended network with history covering heights 900000 through 900999. Store both requested bounds and the network with the returned price. Omitting the range invokes the daemon's default analysis window.

dcrctl ticketvwap 900000 900999

Compare with an unweighted calculation

If two tickets cost 100 DCR each and one costs 160 DCR, their volume-weighted price is 120 DCR. Averaging the two price levels gives 130 DCR and answers a different question. The RPC summarizes the purchase price; transaction fees and later voting rewards belong in separate accounting lines.

github.com ticketvwap