Skip to content

Commit

Permalink
use amountUSD for tweeting
Browse files Browse the repository at this point in the history
  • Loading branch information
monilpat committed Feb 4, 2025
1 parent f286aaf commit 994e1f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/client-coinbase/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ Generate only the tweet text, no commentary or markdown.`;

// Execute token swap
const buy = event.event.toUpperCase() === 'BUY';
const amountInUSD = buy ? amount : amount / Number(event.price);
const txHash = await this.executeTokenSwap(event, amountInUSD, buy);
const amountInCurrency = buy ? amount : amount / Number(event.price);
const txHash = await this.executeTokenSwap(event, amountInCurrency, buy);
if (txHash == null) {
elizaLogger.error('txHash is null');
return;
Expand All @@ -241,7 +241,7 @@ Generate only the tweet text, no commentary or markdown.`;
elizaLogger.info('pnl ', pnl);

// Generate and post tweet
await this.handleTweetPosting(event, amountInUSD, pnl, formattedTimestamp, state, txHash);
await this.handleTweetPosting(event, amount, pnl, formattedTimestamp, state, txHash);
}

private async setupRoom(roomId: UUID) {
Expand Down

0 comments on commit 994e1f7

Please sign in to comment.