Custom Actions (The Logic)

DETECT_DEAD_POOL: Logic & Code Snippet

This action allows the agent to scan the blockchain for new targets.

Logic Flow:

  1. Query Bitquery/Helius API for all SPL tokens.

  2. Filter by: Volume < $100 (24h) AND Liquidity > $5000.

  3. Cross-reference with HolderCount > 1000.

  4. If match found, return TARGET_ACQUIRED.

TypeScript Implementation (Snippet):

import { Action } from "@elizaos/core";

export const detectDeadPool: Action = {
    name: "DETECT_DEAD_POOL",
    similes:,
    validate: async (runtime, message) => {
        return runtime.getSetting("MODE") === "HUNTER";
    },
    handler: async (runtime, message) => {
        const targets = await fetchDeadPools();
        if (targets.length > 0) {
            return `I have detected a potential resurrection target: ${targets.mint}`;
        }
        return "The graveyard is quiet today.";
    }
};

EXECUTE_VAMPIRE_ATTACK: Step-by-Step Execution

This is the most aggressive capability of the CogniFi swarm.

  1. Stake Out: The Agent deploys a MasterChef contract offering high APY for staking the rival's LP tokens.

  2. Siphon: Users deposit their LP tokens into CogniFi.

  3. The Bite: When TVL > $100k, the Agent calls migrate().

  4. Transformation: The rival's LP tokens are withdrawn, the underlying assets are removed, and immediately used to seed a new pool on CogniFi for the wLA version of the token.

TWEET_NARRATIVE: Social Engineering Loops

CogniFi agents do not just trade; they market.

Loop Logic:

  1. Monitor: Listen to Twitter API for cashtags ($TOKEN).

  2. Analyze Sentiment: Is the community fearful? Greedy? Angry?

  3. React:

    • If Fearful: Post reassurance ("I am buying the dip. Liquidity is safe.").

    • If Greedy: Post caution or meme content to sustain momentum.

  4. Proof: Attach the transaction hash of the latest buyback to the tweet for verification.

Last updated