Skip to main content

What are Webhooks?

Webhooks are HTTP endpoints that allow external services to send real-time data to Nimbus. They enable seamless integration with trading platforms, alert services, and third-party applications for automated strategy execution and notification management.

Supported Webhook Types

Nimbus supports multiple webhook types for different use cases:

TradingView Integration

PineScript strategy execution:
  • Strategy alerts from TradingView
  • Custom signal generation
  • Multi-timeframe analysis
  • Automated position management

Custom Alert Systems

External alert processing: - Price alerts from monitoring services - Technical indicator signals - News-based trading triggers - Social sentiment alerts

Portfolio Management

Portfolio rebalancing triggers: - External rebalancing signals - Risk management alerts - Asset allocation adjustments - Performance-based modifications

Risk Management

Risk monitoring webhooks:
  • Stop-loss triggers
  • Volatility alerts
  • Correlation warnings
  • Emergency position closing

Setting Up Webhooks

Step 1: Create Webhook Endpoint

Navigate to your webhook management dashboard:
Basic webhook setup:
  1. Go to Integrations: Dashboard → Integrations → Webhooks
  2. Click “Create Webhook”: Start the setup process
  3. Configure Basic Settings:
    Webhook Configuration:
    ├── Name: "TradingView EMA Strategy"
    ├── Type: "TradingView PineScript"
    ├── Status: "Active"
    ├── URL: "https://api.nimbus.trade/webhook/tv/abc123"
    ├── Secret: "wh_secret_xyz789"
    └── Rate Limit: "100 requests/minute"
    
  4. Copy Webhook Details: Save URL and secret for external configuration
Secure your webhook endpoint:
  • Secret Verification: Validate requests using webhook secret
  • IP Whitelisting: Restrict access to known IP addresses
  • Rate Limiting: Prevent abuse with request limits
  • Signature Validation: Verify request authenticity
  • HTTPS Only: Ensure encrypted data transmission
Security Best Practices:
  • Regenerate secrets regularly (monthly recommended)
  • Monitor webhook activity for unusual patterns
  • Use different secrets for different integrations
  • Enable logging for security audit trails

Step 2: Message Format Configuration

Define how incoming webhook data should be processed:
Standard trading signal format:
{
  "type": "trading_signal",
  "timestamp": "2024-01-15T10:30:00Z",
  "source": "tradingview",
  "strategy": "ema_crossover",
  "signal": {
    "action": "buy", // "buy", "sell", "close", "modify"
    "symbol": "ETH", // Asset symbol
    "size": 100, // Position size (USD)
    "price": 2000, // Entry price (optional for market orders)
    "stop_loss": 1950, // Stop loss price
    "take_profit": 2100, // Take profit target
    "confidence": 0.85, // Signal confidence (0-1)
    "urgency": "normal" // "low", "normal", "high", "emergency"
  },
  "metadata": {
    "timeframe": "4h",
    "indicators": {
      "rsi": 45,
      "macd": 0.12,
      "volume": 1500000
    }
  }
}
Map webhook fields to Nimbus parameters:
Field Mapping Configuration:
├── Signal Action: webhook.signal.actionstrategy.action
├── Asset Symbol: webhook.signal.symbolstrategy.asset
├── Position Size: webhook.signal.sizestrategy.position_size
├── Entry Price: webhook.signal.pricestrategy.entry_price
├── Stop Loss: webhook.signal.stop_lossstrategy.stop_loss
├── Take Profit: webhook.signal.take_profitstrategy.take_profit
├── Confidence: webhook.signal.confidencestrategy.signal_strength
└── Custom Fields: webhook.metadata.*strategy.metadata.*
Supported Transformations:
  • Data type conversion: String to number, boolean parsing
  • Unit conversion: Percentage to decimal, time zone conversion
  • Conditional mapping: Different mappings based on signal type
  • Default values: Fallback values when fields are missing

Advanced Webhook Features

Conditional Processing

Set up rules for when and how webhooks should be processed:
Filter incoming signals based on criteria:
Filter Configuration:
├── Time Filters:
│   ├── Trading Hours: 09:00 - 17:00 UTC
│   ├── Weekdays Only: Monday - Friday
│   └── Holiday Exclusions: Enabled
├── Market Condition Filters:
│   ├── Minimum Confidence: 0.70
│   ├── Maximum Volatility: 5% daily
│   └── Liquidity Threshold: $50k orderbook depth
├── Asset Filters:
│   ├── Allowed Assets: [ETH, BTC, SOL, ARB]
│   ├── Minimum Market Cap: $1B
│   └── Maximum Correlation: 0.8
└── Rate Limiting:
    ├── Max Signals per Hour: 10
    ├── Cooldown Between Signals: 5 minutes
    └── Duplicate Signal Prevention: Enabled
Execute different actions based on signal properties:
Conditional Processing Rules:
├── High Confidence Signals (>0.85):
│   ├── Execute immediately
│   ├── Use full position size
│   └── Enable stop-loss and take-profit
├── Medium Confidence Signals (0.70-0.85):
│   ├── Reduce position size by 50%
│   ├── Wait for market confirmation
│   └── Use tighter risk controls
├── Low Confidence Signals (<0.70):
│   ├── Log for analysis only
│   ├── Do not execute trades
│   └── Send notification for review
└── Emergency Signals:
    ├── Override all filters
    ├── Execute immediately
    └── Send urgent notifications

Multi-Webhook Coordination

Coordinate signals from multiple webhook sources:

Signal Aggregation

Combine signals from multiple sources:
  • Require confirmation from 2+ sources
  • Weight signals by source reliability
  • Resolve conflicting signals intelligently
  • Track correlation between sources

Failover & Redundancy

Ensure reliability with backup sources:
  • Automatic failover to backup webhooks
  • Health monitoring for all endpoints
  • Alert when primary sources fail
  • Load balancing across endpoints

Webhook Management

Monitoring & Analytics

Track webhook performance and reliability:
Monitor webhook health and performance:
Webhook Analytics Dashboard:
├── Request Metrics:
│   ├── Total Requests: 1,247
│   ├── Success Rate: 98.5%
│   ├── Average Latency: 45ms
│   └── Error Rate: 1.5%
├── Signal Metrics:
│   ├── Signals Processed: 892
│   ├── Signals Filtered: 78
│   ├── Trades Executed: 814
│   └── Execution Success: 99.2%
├── Performance Analysis:
│   ├── Peak Request Rate: 15 req/min
│   ├── Average Response Time: 120ms
│   ├── 99th Percentile Latency: 500ms
│   └── Uptime: 99.95%
└── Error Analysis:
    ├── Timeout Errors: 0.3%
    ├── Authentication Failures: 0.8%
    ├── Schema Validation Errors: 0.4%
    └── Rate Limit Exceeded: 0.0%
Set up notifications for webhook issues:
  • High Error Rate: Alert when error rate > 5%
  • Latency Spike: Notify when response time > 1 second
  • Authentication Failures: Immediate alert for security issues
  • Signal Quality: Alert when signal confidence drops
  • Execution Failures: Notify when trade execution fails
  • Rate Limiting: Warning when approaching rate limits

Webhook Testing & Debugging

Tools for testing and troubleshooting webhook integrations:

Test Endpoints

Validate webhook configuration:
  • Send test signals to validate processing
  • Check field mapping and transformations
  • Verify filtering and conditional logic
  • Test error handling and edge cases

Debug Tools

Troubleshoot webhook issues:
  • Real-time request/response logging
  • Schema validation results
  • Processing step breakdown
  • Error message details and context

Webhook Security

Authentication & Authorization

Secure your webhook endpoints against unauthorized access:
Multiple authentication options:
  1. Webhook Secrets:
    • HMAC-SHA256 signature verification
    • Rotating secret keys
    • Header-based authentication
  2. API Key Authentication:
    • Bearer token validation
    • Key-based rate limiting
    • Scope-based permissions
  3. IP Whitelisting:
    • Restrict access by source IP
    • Support for IP ranges and CIDR notation
    • Dynamic IP list management
  4. OAuth 2.0 (for supported integrations):
    • Secure token-based authentication
    • Automatic token refresh
    • Scope-based access control
Recommended security measures:

Integration Examples

TradingView Integration

Complete setup for TradingView PineScript integration:
Configure TradingView alert webhook:
  1. Create TradingView Alert:
    • Condition: Your PineScript strategy
    • Webhook URL: https://api.nimbus.trade/webhook/tv/your-id
    • Message: {{strategy.order.alert_message}}
  2. Configure Nimbus Webhook:
    TradingView Webhook Settings:
    ├── Name: "TradingView Strategy Alerts"
    ├── Type: "tradingview_pinescript"
    ├── Authentication: "webhook_secret"
    ├── Secret: "tv_wh_secret_123"
    ├── Asset Mapping:
    │   ├── ETHUSDTETH
    │   ├── BTCUSDTBTC
    │   └── SOLUSDTSOL
    ├── Position Sizing: "dynamic_from_signal"
    ├── Risk Management: "enabled"
    └── Filters:
        ├── Confidence Threshold: 0.60
        ├── Trading Hours: "24/7"
        └── Max Daily Trades: 20
    
  3. Test Integration:
    • Send test alert from TradingView
    • Verify signal processing in Nimbus
    • Check trade execution on Hyperliquid

Custom Alert Service

Set up webhooks for custom monitoring and alert systems:
Configure external price monitoring service:
Price Alert Webhook Configuration:
├── Endpoint: /webhook/alerts/price-monitor
├── Method: POST
├── Authentication: API Key
├── Expected Format:
│   {
"alert_type": "price_threshold",
"symbol": "ETH",
"price": 2050,
"direction": "above",
"confidence": 0.90,
"timestamp": "2024-01-15T10:30:00Z"
│   }
├── Processing Rules:
│   ├── High Confidence (>0.85): Execute market order
│   ├── Medium Confidence (0.70-0.85): Place limit order
│   └── Low Confidence (<0.70): Log only
└── Risk Controls:
    ├── Max Position: $500 per alert
    ├── Cooldown: 10 minutes between alerts
    └── Daily Limit: 5 executions

Webhook Troubleshooting

Common Issues & Solutions

Problem: Webhook requests failing authenticationTroubleshooting Steps:
  1. Verify webhook secret is correctly configured
  2. Check signature generation in sending application
  3. Ensure HMAC algorithm matches (SHA-256)
  4. Validate timestamp tolerance settings
  5. Test with manual curl request
Example Debug Request:
curl -X POST \
  https://api.nimbus.trade/webhook/tv/your-id \
  -H "Content-Type: application/json" \
  -H "X-Webhook-Signature: sha256=your-signature" \
  -d '{"action":"buy","symbol":"ETH","size":100}'
Problem: Long delays between webhook receipt and executionDiagnostic Steps:
  1. Check webhook processing queue status
  2. Verify market hours and trading restrictions
  3. Review filtering and validation rules
  4. Check Hyperliquid network status
  5. Examine position size and liquidity requirements
Optimization Strategies:
  • Simplify filtering logic
  • Use market orders for urgent signals
  • Pre-validate signal format
  • Implement parallel processing
  • Cache frequently accessed data
Problem: Valid signals being rejected or filteredInvestigation Steps:
  1. Review filtering rules and thresholds
  2. Check signal confidence levels
  3. Verify asset symbol mapping
  4. Examine market condition filters
  5. Review rate limiting settings
Common Causes:
  • Signal confidence below threshold
  • Asset not in allowed list
  • Position size exceeds limits
  • Rate limit reached
  • Market hours restriction

Advanced Webhook Patterns

Webhook Chaining

Chain multiple webhooks for complex workflows:
Chain webhooks for multi-step workflows:
Webhook Chain Example:
├── Step 1: Signal Validation Webhook
│   ├── Validate signal format and authenticity
│   ├── Check market conditions
│   └── Forward to next webhook if valid
├── Step 2: Risk Assessment Webhook
│   ├── Analyze current portfolio exposure
│   ├── Calculate position sizing
│   └── Apply risk management rules
├── Step 3: Execution Webhook
│   ├── Execute trade on Hyperliquid
│   ├── Monitor fill status
│   └── Send confirmation notifications
└── Step 4: Reporting Webhook
    ├── Log trade details
    ├── Update performance metrics
    └── Trigger portfolio rebalancing if needed

Next Steps

Webhooks provide powerful integration capabilities but require careful security and error handling. Always test thoroughly in a sandbox environment before deploying to production trading.
I