TradeFirewall API Documentation

Integrate risk intelligence into your trading platform, wallet, or DeFi application. Get real-time risk scores for any proposed trade.

Quick Start

1. Get API Key

Sign up for a TradeFirewall account and generate your API key from the dashboard.

2. Make Your First Request

Send a POST request to analyze any trade proposal and get a risk score.

API Endpoints

Analyze Trade
POST

Endpoint

POST https://api.tradefirewall.com/v1/analyze-trade

Request Body

{
  "symbol": "BTC",
  "action": "buy",
  "amount": 5000,
  "holdingPeriod": "1day",
  "riskProfile": "balanced"
}

Response

{
  "riskScore": 45,
  "decision": "CAUTION",
  "confidence": 0.85,
  "reasons": [
    "Medium volatility detected",
    "Positive market sentiment"
  ],
  "recommendedAction": "Consider reducing position size by 25%",
  "suggestedPositionSize": "$3,750",
  "marketFactors": {
    "volatility": 55,
    "sentiment": 35,
    "volume": 40,
    "liquidity": 25
  },
  "dataSourcesUsed": ["SoSoValue", "SoDEX"],
  "timestamp": 1640995200000
}
Execution Preview
POST

Endpoint

POST https://api.tradefirewall.com/v1/execution-preview

Response

{
  "symbol": "BTC",
  "estimatedPrice": 45000,
  "estimatedSlippage": 0.015,
  "estimatedFees": 0.001,
  "priceImpact": 0.008,
  "executionProbability": 0.92,
  "warnings": ["High slippage expected"],
  "canExecute": true,
  "mode": "testnet"
}

Authentication

Include your API key in the Authorization header of all requests:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Rate Limits

Free Tier
10
requests per month
Advanced Trader
1,000
requests per month
Enterprise
Unlimited
custom rate limits

Error Codes

CodeDescriptionSolution
400Invalid request formatCheck request body structure
401Invalid API keyVerify your API key
404Symbol not foundUse supported symbols only
429Rate limit exceededUpgrade your plan
503Market data unavailableRetry after a few minutes

SDKs & Libraries

JavaScript
npm install tradefirewall
Python
pip install tradefirewall
Go
go get tradefirewall
Rust
cargo add tradefirewall

Ready to Integrate?

Start building with TradeFirewall API today. Get your API key and begin adding risk intelligence to your platform.