Serverless Webhook-to-Broker Execution
TradingView Paper Trading Automation
Built a paper-first AWS serverless execution path: TradingView strategy alerts hit API Gateway, a receiver Lambda validates and queues the signal, SQS buffers processing, a processor Lambda applies deterministic risk gates and idempotency checks, DynamoDB records redacted signal and order events, Secrets Manager isolates webhook and Alpaca paper credentials, and the Alpaca adapter submits paper orders only.
Challenge
TradingView can generate strategy alerts, but a direct webhook-to-broker path is too brittle for serious paper trading. The execution lane needs payload validation, replay protection, risk controls, audit history, secret isolation, and a live-trading lock before any broker API is allowed to receive an order.
Solution
Built a paper-first AWS serverless execution path: TradingView strategy alerts hit API Gateway, a receiver Lambda validates and queues the signal, SQS buffers processing, a processor Lambda applies deterministic risk gates and idempotency checks, DynamoDB records redacted signal and order events, Secrets Manager isolates webhook and Alpaca paper credentials, and the Alpaca adapter submits paper orders only.
Impact Metrics
Results
- • End-to-end AWS smoke test submitted one Alpaca paper order with accepted broker status
- • 60-test local suite covers payload contracts, risk gates, broker adapters, Lambda handlers, and CloudFormation assets
- • CloudFormation template builds the AWS stack with API Gateway, Lambda, SQS, DynamoDB, Secrets Manager, IAM, CloudWatch, and S3 artifact flow
- • Live trading remains locked by design; broker adapter rejects live mode and non-paper Alpaca endpoints
- • TradingView setup guide and Pine strategy starter make the paper alert path reproducible
Business Impact
Demonstrates production-minded automation for a high-risk domain: event-driven AWS infrastructure, deterministic safety controls, broker abstraction, and paper trading proof without enabling real-money execution.
Architecture
Portfolio POC uses paper trading only. The live path is intentionally unavailable until a separate live-readiness review, explicit approvals, stronger observability, and broker account controls are added.
Paper-First Execution Lane
A proven approach combining statistical rigor, automation, and AWS best practices.
Webhook Contract
TradingView Pine emits a structured JSON payload with symbol, action, quantity, mode, nonce, timestamp, and shared webhook secret.
AWS Ingestion
API Gateway and receiver Lambda validate request shape, redact sensitive values, and enqueue valid signals into SQS for asynchronous processing.
Risk + Idempotency
Processor Lambda checks kill switch, allowed symbols, max notional, stale timestamps, duplicate nonces, and explicit paper/live boundaries before broker submission.
Broker + Audit
Alpaca paper adapter submits paper orders only, then records broker outcomes in DynamoDB with CloudWatch visibility for operational review.
Screenshots

Scale & Scope
Technology Stack
- TradingView Pine Script strategy alerts
- AWS API Gateway HTTP API
- AWS Lambda with Python
- Amazon SQS and dead-letter queue
- Amazon DynamoDB audit and idempotency tables
- AWS Secrets Manager and IAM
- AWS CloudFormation and S3 artifacts
- Alpaca Paper Trading API
Need a similar solution?
Let's replicate this success within your organization with a tailored engagement plan.