Quote the ticket price for the next Decred block
A ticket purchase targets a future block, whereas a dashboard may still show the stake difficulty of the tip. At a price boundary these amounts can differ.
Read the two prices from one observation
Ask the node your ticket builder uses. current describes the top block and next is calculated for its successor. Record the corresponding tip hash with the quote if another process may build the purchase later.
dcrctl getstakedifficulty | jq '{current, next}'
Budget the correct component
If the two fields are 110 and 115 DCR, a purchase intended for the immediate successor uses the 115 DCR figure for its ticket price. The transaction fee is additional. A stale quote may cease to apply after the tip advances, so recalculate before constructing a delayed purchase.