In the fast-moving world of decentralized finance, the "time-to-trade" is everything. Traditionally, a trader sees a "Smart Money" move on a dashboard, manually verifies the contract, and then heads to a DEX to execute. By the time that loop finishes, the alpha is often gone.
I built Shadow-Signal, an autonomous agentic script that collapses this entire workflow into a single loop using the new Nansen CLI.
The Architecture
Shadow-Signal is built using a Node.js wrapper around the Nansen CLI, designed to act as a "Sentinel" for high-conviction Smart Money moves on Solana and Base.
The logic flows through three distinct layers of the Nansen ecosystem:
The Discovery Layer (nansen research):
The script polls the smart-money netflow endpoint. Unlike a broad scan, I used the --fields flag to limit data transfer and focused on the 24h timeframe to identify sustained accumulation rather than transient noise.The Reasoning Layer (nansen agent):
This is where the "Agentic" part comes in. Raw data doesn't tell the whole story. Before any trade is considered, the script pipes the token symbol into the Nansen AI Agent. It asks for a risk assessment—checking for potential red flags or "rug-pull" sentiment that the raw netflow numbers might miss.The Execution Layer (nansen trade):
If the AI Agent gives a "Green Light," the script moves to execution. It interfaces with Nansen’s local wallet system to generate a DEX quote (trade quote) and prepares the transaction for final execution.
Technical Challenges & Optimizations
- Credit Efficiency: AI Agent calls are high-value. I optimized the script to only trigger the Agent check if the Smart Money inflow exceeds a specific dollar threshold, preventing unnecessary credit burn.
- JSON Orchestration: By using the CLI’s JSON output format, I was able to programmatically parse on-chain data and feed it directly into trade logic, removing human error from the equation.
Shadow-Signal isn't just a bot; it’s a proof-of-concept for Agentic Finance. By using Nansen’s CLI as the "brain" and "eyes," we can now build tools that don't just show us the data, but act on it.
Github Gist: https://gist.github.com/harishkotra/9ed34cd6c892b910c163fe66137ccd22
Top comments (0)