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 — March 12, 2026
Market Regime: Mean-Reverting
Safety Score: 95.6 (HIGH)

Composite Signals:
  BTC: neutral (score: 0.028)\n  ETH: buy (score: 0.236)\n  SOL: buy (score: 0.183)\n  HYPE: strong_buy (score: 0.319)\n
# The bot would use this data to make trading decisions

Complete Source Code

Copy this code, replace YOUR_API_KEY with your key, and run:

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

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

const API_KEY = "YOUR_API_KEY";
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?api_key=${{API_KEY}}`);
        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?api_key=${{API_KEY}}`);
        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?api_key=${{API_KEY}}`).then(r => r.json()),
          fetch(`${{BASE}}/v3/signals/squeeze?api_key=${{API_KEY}}`).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. Get an API key from the API page
  2. Replace YOUR_API_KEY in the code above
  3. Install dependencies: pip install requests (Python) or npm install node-fetch (TypeScript)
  4. Run the script and monitor the output
  5. Connect your exchange API for live trading

API Endpoints Used

Framework
ElizaOS + TypeScript
Data Source
Algo Tick API
# All endpoints used by this template:
curl -H "X-API-Key: YOUR_KEY" https://algotick.dev/v3/signals/regime
curl -H "X-API-Key: YOUR_KEY" https://algotick.dev/v1/signals/composite
curl -H "X-API-Key: YOUR_KEY" https://algotick.dev/v3/signals/safety
curl -H "X-API-Key: YOUR_KEY" 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.

Get API Key →

More Eliza Os Templates

Other Frameworks