1
1
import {
2
2
TrustScoreDatabase ,
3
3
TokenPerformance ,
4
- TradePerformance ,
5
- TokenRecommendation ,
4
+ // TradePerformance,
5
+ // TokenRecommendation,
6
6
ProcessedTokenData ,
7
7
} from "@ai16z/plugin-trustdb" ;
8
8
import { Connection , PublicKey } from "@solana/web3.js" ;
9
9
// Assuming TokenProvider and IAgentRuntime are available
10
10
import { TokenProvider } from "./token.ts" ;
11
- import { settings } from "@ai16z/eliza" ;
11
+ // import { settings } from "@ai16z/eliza";
12
12
import { IAgentRuntime , Memory , Provider , State } from "@ai16z/eliza" ;
13
13
import { WalletProvider } from "./wallet.ts" ;
14
14
import * as amqp from "amqplib" ;
@@ -31,6 +31,7 @@ export class simulationSellingService {
31
31
private amqpChannel : amqp . Channel ;
32
32
private sonarBe : string ;
33
33
private sonarBeToken : string ;
34
+ private runtime : IAgentRuntime ;
34
35
35
36
private runningProcesses : Set < string > = new Set ( ) ;
36
37
@@ -55,6 +56,7 @@ export class simulationSellingService {
55
56
this . initializeRabbitMQ ( runtime . getSetting ( "AMQP_URL" ) ) ;
56
57
this . sonarBe = runtime . getSetting ( "SONAR_BE" ) ;
57
58
this . sonarBeToken = runtime . getSetting ( "SONAR_BE_TOKEN" ) ;
59
+ this . runtime = runtime ;
58
60
}
59
61
/**
60
62
* Initializes the RabbitMQ connection and starts consuming messages.
@@ -143,7 +145,8 @@ export class simulationSellingService {
143
145
const sellTimeStamp = new Date ( ) . toISOString ( ) ;
144
146
const tokenProvider = new TokenProvider (
145
147
tokenAddress ,
146
- this . walletProvider
148
+ this . walletProvider ,
149
+ this . runtime . cacheManager
147
150
) ;
148
151
149
152
// Update sell details in the database
@@ -201,7 +204,8 @@ export class simulationSellingService {
201
204
tokenPerformances . forEach ( async ( tokenPerformance ) => {
202
205
const tokenProvider = new TokenProvider (
203
206
tokenPerformance . tokenAddress ,
204
- this . walletProvider
207
+ this . walletProvider ,
208
+ this . runtime . cacheManager
205
209
) ;
206
210
const shouldTrade = await tokenProvider . shouldTradeToken ( ) ;
207
211
if ( shouldTrade ) {
0 commit comments