All Agent Setups
Treasury risk-controlled executionMedium complexityTreasuries / DAOs

Hermes + CoinGlass + RiskState + Safe

DAO or team treasury agent with multisig governance. CoinGlass provides market context, RiskState enforces policy limits, Safe Smart Account ensures multi-party execution control.

How it works

1

CoinGlass provides market intelligence

Your agent queries CoinGlass for real-time market data — funding rates, open interest, liquidation maps, CVD, and ETF flows. Hobbyist or starter tier.

2

RiskState gates the decision

Before any execution, your agent calls POST /v1/risk-state. The response contains max_size_fraction (position ceiling), allowed_actions (what’s permitted), and structural_blockers (hard stops). If blockers exist, the agent halts. Otherwise, it sizes the trade within the policy limit. 30+ signals scored in real-time, 60-second cache, SHA-256 audit hash.

3

Safe executes within limits

The trade is submitted to Safe as a multisig transaction. M-of-N signers must approve before funds move. Full on-chain governance. Position size never exceeds what RiskState permitted.

Integration code

Copy this into your project. Replace the API keys with your own.

hermes_riskstate_safe.py
import requests
from safe_eth.safe import Safe

# 1. Get market context from CoinGlass
market = requests.get(
    "https://open-api-v3.coinglass.com/api/futures/open-interest",
    headers={"coinglassSecret": COINGLASS_KEY},
    params={"symbol": "BTC"}
).json()

# 2. Get risk policy from RiskState
policy = requests.post(
    "https://riskstate.netlify.app/v1/risk-state",
    headers={"Authorization": f"Bearer {RISKSTATE_KEY}"},
    json={"asset": "BTC"}
).json()

max_size = policy["exposure_policy"]["max_size_fraction"]
blockers = policy["risk_flags"]["structural_blockers"]

# 3. Enforce governance for treasury
if blockers:
    print(f"Treasury action blocked: {blockers}")
elif max_size < 0.35:
    print("Defensive policy — treasury holds")
else:
    # 4. Propose Safe multisig transaction
    safe = Safe(SAFE_ADDRESS, ethereum_client)
    tx = safe.build_multisig_tx(
        to=COW_SETTLEMENT,
        value=0,
        data=swap_calldata,
    )
    # Requires M-of-N signers to execute
    print(f"Safe tx proposed: {tx.safe_tx_hash}")

What your agent receives from RiskState

Every call to /v1/risk-state returns these three blocks. Your agent reads them in order.

Exposure Policy

Binding
  • max_size_fraction — hard ceiling
  • leverage_allowed — boolean
  • allowed_actions — enum list
  • blocked_actions — enum list

Market Intelligence

Context
  • tactical_state — LEAN BULL, etc.
  • market_regime — TREND, RANGE...
  • binding_constraint — source + why
  • risk_flags — blockers + risks

Auditability

Trust
  • policy_hash — SHA-256
  • confidence_score — 0-100
  • data_sources — per-signal
  • ttl_seconds — cache hint

Start building

Get an API key in under a minute. Free during beta.