Getting Started
Deploy your first agent with Spectra
Getting Started
Get your agent running with Spectra in three steps.
1. Install the SDK
pip install spectra-sdknpm install @spectra/sdk2. Configure Your Agent
from spectra import Agent, Config
config = Config(
max_position_size=10000,
max_daily_loss=5000,
risk_tolerance='moderate',
max_frequency_per_min=10,
allowed_strategies=['momentum', 'arbitrage']
)
agent = Agent(
name='MyAgent',
config=config,
api_key='your-api-key'
)import { Agent, Config } from '@spectra/sdk';
const config: Config = {
maxPositionSize: 10000,
maxDailyLoss: 5000,
riskTolerance: 'moderate',
maxFrequencyPerMin: 10,
allowedStrategies: ['momentum', 'arbitrage']
};
const agent = new Agent({
name: 'MyAgent',
config,
apiKey: process.env.SPECTRA_API_KEY
});3. Test and Deploy
# Test in sandbox first
agent.deploy(environment='sandbox')
results = agent.run_backtest(
start_date='2026-01-01',
end_date='2026-01-17',
initial_capital=100000
)
print(f"Sharpe: {results.sharpe_ratio}, Drawdown: {results.max_drawdown}")
# Deploy to production with circuit breaker
agent.deploy(
environment='production',
circuit_breaker=True,
alert_email='your-email@example.com'
)Always validate in sandbox before production. The circuit breaker will automatically halt your agent if it detects anomalous behavior.
Configuration Options
| Parameter | Type | Description |
|---|---|---|
maxPositionSize | number | Maximum size per position |
maxDailyLoss | number | Auto-halt threshold |
riskTolerance | string | conservative, moderate, aggressive |
maxFrequencyPerMin | number | Trade rate limit |
allowedStrategies | string[] | Permitted strategies |
Next Steps
- API Reference - Full SDK documentation
- Best Practices - Production guidelines