Skip to content

Commit

Permalink
fix the recommended open order
Browse files Browse the repository at this point in the history
  • Loading branch information
Flaque committed Sep 14, 2024
1 parent d6be0ae commit 9687a0e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/lib/buy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,9 @@ async function buyOrderAction(options: SfBuyOptions) {
if (!quote) {
const durationInHours = durationSeconds / 3600;

// In the future, we should read from a price chart of yesterday's prices.
// For now, we'll just suggest 2.50 / gpu-hour as a default
const todoEstimatedPricePerNodeCents = 250 * 8; // $2.50 / gpu-hour * 8 gpus
const estimatedPriceInCents =
todoEstimatedPricePerNodeCents * quantity * durationInHours; // multiply by desired quantity and duration to get total estimated price in cents

console.log(`No one is selling this right now. To ask someone to sell it to you, add a price you're willing to pay. For example:
sf buy -i ${options.type} -d "${durationInHours}h" -n ${quantity} -p "$${(estimatedPriceInCents / 100).toFixed(2)}"
sf buy -d "${durationInHours}h" -n ${quantity * GPUS_PER_NODE} -p "2.50"
`);

return process.exit(1);
Expand Down

0 comments on commit 9687a0e

Please sign in to comment.