Skip to content

Commit 0b029c0

Browse files
committed
sell simulation service
Signed-off-by: MarcoMandar <malicemandar@gmail.com>
1 parent ea0984f commit 0b029c0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/plugin-solana/src/providers/simulationSellingService.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {
22
TrustScoreDatabase,
33
TokenPerformance,
4-
TradePerformance,
5-
TokenRecommendation,
4+
// TradePerformance,
5+
// TokenRecommendation,
66
ProcessedTokenData,
77
} from "@ai16z/plugin-trustdb";
88
import { Connection, PublicKey } from "@solana/web3.js";
99
// Assuming TokenProvider and IAgentRuntime are available
1010
import { TokenProvider } from "./token.ts";
11-
import { settings } from "@ai16z/eliza";
11+
// import { settings } from "@ai16z/eliza";
1212
import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza";
1313
import { WalletProvider } from "./wallet.ts";
1414
import * as amqp from "amqplib";
@@ -31,6 +31,7 @@ export class simulationSellingService {
3131
private amqpChannel: amqp.Channel;
3232
private sonarBe: string;
3333
private sonarBeToken: string;
34+
private runtime: IAgentRuntime;
3435

3536
private runningProcesses: Set<string> = new Set();
3637

@@ -55,6 +56,7 @@ export class simulationSellingService {
5556
this.initializeRabbitMQ(runtime.getSetting("AMQP_URL"));
5657
this.sonarBe = runtime.getSetting("SONAR_BE");
5758
this.sonarBeToken = runtime.getSetting("SONAR_BE_TOKEN");
59+
this.runtime = runtime;
5860
}
5961
/**
6062
* Initializes the RabbitMQ connection and starts consuming messages.
@@ -143,7 +145,8 @@ export class simulationSellingService {
143145
const sellTimeStamp = new Date().toISOString();
144146
const tokenProvider = new TokenProvider(
145147
tokenAddress,
146-
this.walletProvider
148+
this.walletProvider,
149+
this.runtime.cacheManager
147150
);
148151

149152
// Update sell details in the database
@@ -201,7 +204,8 @@ export class simulationSellingService {
201204
tokenPerformances.forEach(async (tokenPerformance) => {
202205
const tokenProvider = new TokenProvider(
203206
tokenPerformance.tokenAddress,
204-
this.walletProvider
207+
this.walletProvider,
208+
this.runtime.cacheManager
205209
);
206210
const shouldTrade = await tokenProvider.shouldTradeToken();
207211
if (shouldTrade) {

0 commit comments

Comments
 (0)