Skip to content

Node extension price calculation#253

Draft
sigmachirality wants to merge 1 commit intomainfrom
cursor/node-extension-price-calculation-597f
Draft

Node extension price calculation#253
sigmachirality wants to merge 1 commit intomainfrom
cursor/node-extension-price-calculation-597f

Conversation

@sigmachirality
Copy link
Member

Fixes sf nodes extend command showing 10x inflated prices by correcting quote API parameters and price calculation logic.

The previous implementation incorrectly passed quantity: 8 (GPUs per node) to the quote API's quantity parameter (number of nodes), inflating each quote by 8x. Additionally, the multi-node total summed raw quote prices, which included an extra hour for duration flexibility, leading to a further ~1.25x overestimation. These compounded to a ~10x error.


Slack Thread

Open in Web Open in Cursor 

Two bugs caused the multi-node extend confirmation to display ~10x the
correct price:

1. The quote API was called with quantity=8 (GPUs per node) instead of
   quantity=1 (one node per quote). The API's quantity parameter means
   'number of nodes', not GPUs. This inflated each quote's total price
   by 8x.

2. The multi-node total was computed by summing raw quote prices, which
   include the full quoted duration. Because the quote request adds
   flexibility (up to +1 hour), a 4-hour request could yield 5-hour
   quotes, adding another ~1.25x. Combined: 8 * 1.25 = 10x.

Fix:
- Change quantity from 8 to 1 in the per-node getQuote call
- Normalize multi-node total using per-node-hour rates (via
  getPricePerGpuHourFromQuote) multiplied by the actual requested
  duration, matching the single-node code path

Co-authored-by: Daniel Tao <danieltaox@gmail.com>
@cursor
Copy link

cursor bot commented Feb 26, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@semanticdiff-com
Copy link

semanticdiff-com bot commented Feb 26, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  src/lib/nodes/extend.ts  37% smaller
  src/helpers/test/quote.test.ts  0% smaller

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