Skip to content

Risk Management Agent

Autonomous risk monitor that adjusts position sizes based on safety score and squeeze probability. Framework: ElizaOS + TypeScript.

Live Output Preview

If you ran this bot right now, the API would return:

# Live API output — June 17, 2026
Market Regime: Trending
Safety Score: 94.4 (HIGH)

Composite Signals:
  BTC: sell (score: -0.287)\n  ETH: neutral (score: -0.069)\n  SOL: neutral (score: 0.003)\n  HYPE: buy (score: 0.114)\n
# The bot would use this data to make trading decisions

Complete Source Code

Copy this code and run — no API key required:

// ElizaOS Agent: Risk Management
// Autonomous risk monitor adjusting positions based on safety & squeeze signals

import {{ Agent, Action }} from "@eliza-os/core";

const BASE = "https://algotick.dev";

const riskAgent = new Agent({{
  name: "Risk Management Agent",
  description: "Monitors safety scores and squeeze probability to manage risk",

  actions: [
    new Action({{
      name: "check_safety",
      description: "Get cross-signal safety and coherence score",
      handler: async () => {{
        const resp = await fetch(`${{BASE}}/v3/signals/safety`);
        const data = await resp.json();
        return `Safety: ${{data.coherence_score}} (${{data.safety_level}})\n` +
               `Recommendation: ${{data.recommendation}}`;
      }}
    }}),

    new Action({{
      name: "check_squeeze_risk",
      description: "Check squeeze probability for all coins",
      handler: async () => {{
        const resp = await fetch(`${{BASE}}/v3/signals/squeeze`);
        const data = await resp.json();
        return data.squeezes.map((s: any) =>
          `${{s.coin}}: ${{s.squeeze_probability_pct.toFixed(1)}}% ${{s.squeeze_direction}}`
        ).join("\n");
      }}
    }}),

    new Action({{
      name: "adjust_position_size",
      description: "Reduce position sizes when risk is elevated",
      handler: async ({{ coin }}) => {{
        const [safety, squeeze] = await Promise.all([
          fetch(`${{BASE}}/v3/signals/safety`).then(r => r.json()),
          fetch(`${{BASE}}/v3/signals/squeeze`).then(r => r.json()),
        ]);
        const sq = squeeze.squeezes.find((s: any) => s.coin === coin);
        const risk = (100 - safety.coherence_score) + (sq?.squeeze_probability_pct || 0);
        const sizeMultiplier = Math.max(0.1, 1 - risk / 100);
        return `${{coin}} position size multiplier: ${{sizeMultiplier.toFixed(2)}}x`;
      }}
    }})
  ]
}});

Setup Instructions

  1. Install dependencies: pip install requests (Python) or npm install node-fetch (TypeScript)
  2. Run the script and monitor the output
  3. Connect your exchange API for live trading

API Endpoints Used

Framework
ElizaOS + TypeScript
Data Source
Algo Tick API
# No API key required. All endpoints used by this template:
curl https://algotick.dev/v3/signals/regime
curl https://algotick.dev/v1/signals/composite
curl https://algotick.dev/v3/signals/safety
curl https://algotick.dev/v1/signals/volatility?coin=BTC

Don't just stare at the dashboard. Automate it.

Every metric on this page is available via our sub-millisecond API.
Build trading bots, backtest strategies, and power AI agents with institutional-grade data.

Explore API →

More Eliza Os Templates

Other Frameworks

Continue the Research

⚡ API Docs📁 Data Library📖 Playbooks🎯 Alpha Strategies