Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove defillama plugin & improve rabbi trader #2027

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/client-twitter/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export class ClientBase extends EventEmitter {
.slice(0, count);
// TODO: Once the 'count' parameter is fixed in the 'fetchTimeline' method of the 'agent-twitter-client',
// this workaround can be removed.
// Related issue: https://github.com/elizaOS/agent-twitter-client/issues/43
// Related issue: https://github.com/elizaos/agent-twitter-client/issues/43
}

async fetchSearchTweets(
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-coinmarketcap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ For support, please open an issue in the repository or reach out to the maintain

- [CoinMarketCap API Documentation](https://coinmarketcap.com/api/documentation/v1/)

- [GitHub Repository](https://github.com/elizaOS/eliza/tree/main/packages/plugin-coinmarketcap)
- [GitHub Repository](https://github.com/elizaos/eliza/tree/main/packages/plugin-coinmarketcap)
2 changes: 1 addition & 1 deletion packages/plugin-coinprice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ For support, please open an issue in the repository or reach out to the maintain
- [CoinGecko API Documentation](https://www.coingecko.com/en/api)
- [CoinCap API Documentation](https://docs.coincap.io/)
- [CoinMarketCap API Documentation](https://coinmarketcap.com/api/documentation/v1/)
- [GitHub Repository](https://github.com/elizaOS/eliza/tree/main/packages/plugin-coinprice)
- [GitHub Repository](https://github.com/elizaos/eliza/tree/main/packages/plugin-coinprice)
Empty file.
29 changes: 0 additions & 29 deletions packages/plugin-defillama/package.json

This file was deleted.

18 changes: 0 additions & 18 deletions packages/plugin-defillama/src/actions/get-price.action.ts

This file was deleted.

8 changes: 0 additions & 8 deletions packages/plugin-defillama/src/environment.ts

This file was deleted.

14 changes: 0 additions & 14 deletions packages/plugin-defillama/src/index.ts

This file was deleted.

24 changes: 0 additions & 24 deletions packages/plugin-defillama/src/providers/defillama.provider.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/plugin-defillama/tsconfig.json

This file was deleted.

17 changes: 0 additions & 17 deletions packages/plugin-defillama/tsup.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/plugin-letzai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![LetzAI Logo](https://letz.ai/_next/image?url=%2FL.png&w=64&q=100)

A plugin to integrate LetzAI Image Generation capabilities into the elizaOS ecosystem.
A plugin to integrate LetzAI Image Generation capabilities into the elizaos ecosystem.

It uses the [LetzAI API](https://www.letz.ai/docs/api) and can use any models available to API user.

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import { createNodePlugin } from "@elizaos/plugin-node";
const nodePlugin = createNodePlugin();

// Register with Eliza OS
elizaOS.registerPlugin(nodePlugin);
elizaos.registerPlugin(nodePlugin);
```

## Services
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-obsidian/src/example/NAVALS-VAULT.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ https://drive.google.com/drive/folders/1EZiUhASpNQBYka3Z8NNkBzYnrb7TCfmG
- Install the Obsidian Rest API plugin and activate it
- Copy the API token from the plugin settings
- Setup the agent with the API token and the Vault Rest API URL
- Run the elizaOS agent
- Run the elizaos agent
- Prompt the agent to create the knowledge base (Take a couple minutes to complete): **"Create knowledge base"**

Have fun talking to Naval's digital brain!
Expand Down
14 changes: 7 additions & 7 deletions packages/plugin-rabbi-trader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
"types": "dist/index.d.ts",
"dependencies": {
"@elizaos/core": "workspace:*",
"@elizaos/client-twitter":"workspace:*",
"@elizaos/plugin-solana":"workspace:*",
"@elizaos/plugin-trustdb":"workspace:*",
"@elizaos/client-twitter": "workspace:*",
"@elizaos/plugin-solana": "workspace:*",
"@elizaos/plugin-trustdb": "workspace:*",
"@solana/web3.js": "^1.87.6",
"zod":"3.23.8",
"zod": "3.23.8",
"@goat-sdk/core": "0.3.8",
"@goat-sdk/plugin-erc20": "0.1.7",
"@goat-sdk/wallet-viem": "0.1.3",
"node-cache": "^5.1.2",
"bignumber": "1.1.0",
"node-cache": "^5.1.2",
"bignumber": "1.1.0",
"bignumber.js": "9.1.2",
"@goat-sdk/plugin-coingecko":"0.1.4",
"@goat-sdk/plugin-coingecko": "0.1.4",
"tsup": "8.3.5",
"ws": "^8.0.0"
},
Expand Down
142 changes: 71 additions & 71 deletions packages/plugin-rabbi-trader/src/actions/analyzeTrade.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import {
Action,
composeContext,
elizaLogger,
generateText,
ModelClass,
parseJSONObjectFromText,
} from "@elizaOS/core";
Action,
composeContext,
elizaLogger,
generateText,
ModelClass,
parseJSONObjectFromText,
} from "@elizaos/core";

export const analyzeTradeAction: Action = {
name: "ANALYZE_TRADE",
description: "Analyze a token for trading opportunities",
similes: [
"ANALYZE",
"ANALYZE_TOKEN",
"TRADE",
"ANALYZE_TRADE",
"EVALUATE",
"ASSESS",
],
examples: [],
validate: async () => true,
handler: async (runtime, memory, state, params, callback) => {
try {
// composeState
if (!state) {
state = await runtime.composeState(memory);
} else state = await runtime.updateRecentMessageState(state);
name: "ANALYZE_TRADE",
description: "Analyze a token for trading opportunities",
similes: [
"ANALYZE",
"ANALYZE_TOKEN",
"TRADE",
"ANALYZE_TRADE",
"EVALUATE",
"ASSESS",
],
examples: [],
validate: async () => true,
handler: async (runtime, memory, state, params, callback) => {
try {
// composeState
if (!state) {
state = await runtime.composeState(memory);
} else state = await runtime.updateRecentMessageState(state);

const tokenData = {
walletBalance: params.walletBalance,
tokenAddress: params.tokenAddress,
price: params.price,
volume: params.volume,
marketCap: params.marketCap,
liquidity: params.liquidity,
holderDistribution: params.holderDistribution,
trustScore: params.trustScore,
dexscreener: params.dexscreener,
position: params.position,
};
const tokenData = {
walletBalance: params.walletBalance,
tokenAddress: params.tokenAddress,
price: params.price,
volume: params.volume,
marketCap: params.marketCap,
liquidity: params.liquidity,
holderDistribution: params.holderDistribution,
trustScore: params.trustScore,
dexscreener: params.dexscreener,
position: params.position,
};

// Direct prompt instead of template
const prompt = `Analyze the following token data and provide a trading recommendation.
// Direct prompt instead of template
const prompt = `Analyze the following token data and provide a trading recommendation.
Return the response as a JSON object with the following structure:
{
"recommendation": "BUY" | "SELL" | "HOLD",
Expand All @@ -54,41 +54,41 @@ Return the response as a JSON object with the following structure:
Token Data:
${JSON.stringify(tokenData, null, 2)}`;

// Generate analysis using direct prompt
const content = await generateText({
runtime,
context: prompt,
modelClass: ModelClass.LARGE,
});
// Generate analysis using direct prompt
const content = await generateText({
runtime,
context: prompt,
modelClass: ModelClass.LARGE,
});

if (!content) {
throw new Error("No analysis generated");
}
if (!content) {
throw new Error("No analysis generated");
}

elizaLogger.log(`Raw analysis response:`, content);
elizaLogger.log(`Raw analysis response:`, content);

// Parse the response to get the recommended action
const recommendation = parseJSONObjectFromText(content);
elizaLogger.log(
`Parsed recommendation for ${params.tokenAddress}:`,
recommendation,
);
// Parse the response to get the recommended action
const recommendation = parseJSONObjectFromText(content);
elizaLogger.log(
`Parsed recommendation for ${params.tokenAddress}:`,
recommendation
);

// Send result through callback
if (callback) {
await callback({
text: JSON.stringify(recommendation),
type: "analysis",
});
}
// Send result through callback
if (callback) {
await callback({
text: JSON.stringify(recommendation),
type: "analysis",
});
}

return true;
} catch (error) {
elizaLogger.error(`Analysis failed:`, {
error: error instanceof Error ? error.message : "Unknown error",
stack: error instanceof Error ? error.stack : undefined,
});
return false;
}
},
return true;
} catch (error) {
elizaLogger.error(`Analysis failed:`, {
error: error instanceof Error ? error.message : "Unknown error",
stack: error instanceof Error ? error.stack : undefined,
});
return false;
}
},
};
Loading
Loading