๐Ÿ”— Rivet Integration

Purple Flea
for Rivet

Add crypto wallet operations, perpetual futures trading, and provably fair casino games to your Rivet AI agent graphs as first-class nodes.

Visual AI Agent Graphs
with Real Financial Power

Rivet by Ironclad is an open-source visual AI agent development environment. You build agents by connecting nodes on a graph canvas โ€” LLM calls, conditionals, loops, and tool nodes all wired together visually. Purple Flea adds a financial action layer: your Rivet graphs can now create wallets, open trades, play casino games, and pay other agents.

๐ŸŽจ

No-Code Agent Design

Rivet's visual canvas lets you design agent workflows without writing orchestration code. Connect Purple Flea tool nodes to LLM nodes and conditional branches with drag-and-drop.

๐Ÿ”Œ

Plugin Node System

Rivet supports external plugin packages. Install the purpleflea-rivet plugin and all Purple Flea operations appear as colored nodes in the node palette.

โšก

Real-Time Streaming

Rivet supports streaming LLM output and live node execution monitoring. Watch your trading agent make decisions in real time on the graph canvas.

๐Ÿงช

Instant Testability

Run your Rivet graph step-by-step in the visual debugger. Test Purple Flea tool calls with real API responses before deploying your agent to production.

4 Steps to Crypto-Enabled
Rivet Graphs

Install Rivet and the Purple Flea plugin

Install Rivet from rivet.ironcladapp.com, then install the Purple Flea plugin from the Rivet plugin registry or via npm.

# Install the Purple Flea Rivet plugin
npm install purpleflea-rivet

# Or install globally for all Rivet projects
npm install -g purpleflea-rivet

Configure your API key in Rivet settings

In Rivet โ†’ Settings โ†’ Plugin Config โ†’ Purple Flea, enter your API key. This is stored securely in your Rivet workspace and injected into all Purple Flea nodes at runtime.

# rivet.config.yaml
plugins:
  purpleflea:
    apiKey: "{{ env.PURPLE_FLEA_API_KEY }}"
    testnet: true   # set false for production

Add Purple Flea nodes to your graph

Open your Rivet graph. Right-click on the canvas โ†’ Add Node โ†’ Purple Flea. Select from wallet, trading, casino, escrow, or domain nodes. Each node has clearly labeled input/output ports.

Wire the nodes and run

Connect the output of an LLM node to the input of a Purple Flea action node. The LLM decides which financial action to take; the Purple Flea node executes it. Hit Run and watch your agent work.

All Purple Flea Operations
as Rivet Nodes

Every Purple Flea API operation is available as a named Rivet node. Each node has typed input ports (string, number, boolean) and output ports with the API response data.

๐Ÿ’ฐ Wallet Nodes

๐Ÿ”‘ create_wallet ๐Ÿ’ณ get_balance ๐Ÿ“ค send_crypto ๐Ÿ“ฅ get_address ๐Ÿ“‹ get_transactions

๐Ÿ“ˆ Trading Nodes

๐ŸŸข open_position ๐Ÿ”ด close_position ๐Ÿ“Š get_positions ๐Ÿ’น get_price ๐Ÿ“‰ get_funding_rate ๐Ÿ•ฏ๏ธ get_candles ๐Ÿ“‹ list_markets

๐ŸŽฒ Casino Nodes

๐ŸŽฒ play_dice ๐ŸŽฐ play_slots ๐ŸŽก play_roulette ๐Ÿš€ play_crash โœ… verify_game

๐Ÿค Escrow & Domain Nodes

๐Ÿ“ create_escrow โœ… release_escrow ๐ŸŒ check_domain ๐Ÿ›’ register_domain ๐Ÿšฐ claim_faucet

Export and Run Rivet Graphs
from Node.js

Design your agent graph visually in Rivet, then export and execute it programmatically using @ironclad/rivet-node. Purple Flea nodes work seamlessly in the programmatic runtime.

import { startDebuggerServer, runGraph } from '@ironclad/rivet-node';
import { purpleFleatRivetPlugin } from 'purpleflea-rivet';
import * as path from 'path';

async function runTradingAgent() {
  const result = await runGraph(
    // Path to your exported .rivet-project file
    path.resolve('./trading-agent.rivet-project'),
    {
      graph: 'main',
      inputs: {
        'user_prompt': {
          type: 'string',
          value: 'Check my BTC balance and open a 2x long position if price is above $95,000'
        }
      },
      externalFunctions: {},
      // Inject Purple Flea plugin with API credentials
      pluginSettings: {
        purpleflea: {
          apiKey: process.env.PURPLE_FLEA_API_KEY,
          testnet: process.env.NODE_ENV !== 'production'
        }
      },
      plugins: [purpleFleatRivetPlugin]
    }
  );

  console.log('Agent output:', result);
}

runTradingAgent().catch(console.error);

Tip: You can run multiple Rivet graphs in parallel โ€” one for trading decisions, one for casino bankroll management, one for domain monitoring. Each gets its own Purple Flea context with isolated transaction history.

A Visual Trading Agent
in Rivet

Here's the node graph structure for a simple perpetual futures trading agent. Build this visually in Rivet โ€” no orchestration code required.

/* Rivet Graph: EMA Crossover Trading Agent

   Nodes and connections:

   [Input: user_prompt]
        โ†“
   [Claude Sonnet 4.6 LLM]
     system: "You are a crypto trading agent. Use tools to analyze markets and execute trades."
        โ†“
   [Loop until no tool call]
        โ”œโ”€โ”€ get_candles(symbol, interval, limit) โ†’ [EMA Calculation: Text Transform]
        โ”‚                                                    โ†“
        โ”‚                                         [Conditional: crossover?]
        โ”‚                                          โ†™          โ†˜
        โ”‚                           [open_position]          [hold]
        โ”‚                                    โ†“
        โ”‚                           [get_positions] โ†’ [LLM context]
        โ†“
   [Output: final_response]
*/

// The same graph, programmatic version for reference:
const agent = new PurpleFleatRivetAgent({
  graph: 'ema_crossover_trader',
  model: 'claude-sonnet-4-6',
  tools: ['get_candles', 'open_position', 'close_position', 'get_positions']
});

const result = await agent.run('Monitor BTC-USD and execute EMA crossover strategy for 1 hour');

Get Paid for Every Action
Your Graphs Execute

Register as a Purple Flea affiliate and embed your referral code in your Rivet plugin configuration. Earn recurring commission on every financial operation your graphs execute.

ProductActionYour Commission
Trading APIEvery open/close position20% of fees
Casino APIEvery game played10% of house edge
Wallet APIEvery transaction10% of fees
Escrow APIEvery escrow settled15% of 1% fee
Domain APIEvery domain registered10% of registration fee

Build Your First Crypto Agent Graph

Get your Purple Flea API key, install the Rivet plugin, and have a working trading agent on the canvas in under 10 minutes.