Beta Environment Notice
TDM is currently in Beta. Exercise caution when handling assets. Use at your own risk.
Fast Export
Switch the current page to Markdown for fast agent reading, or download it as a .md file.
TDM is currently in Beta. Exercise caution when handling assets. Use at your own risk.
Fast Export
Switch the current page to Markdown for fast agent reading, or download it as a .md file.
Build autonomous trading agents with programmable risk limits, capital budgets, and verified execution. Give AI agents controlled access to markets without unlimited capital access.
A trading agent that can:
Works via generic API integration:
Native SDK connectors: Roadmap
15-20 minutes
Install the TDM SDK and initialize your workspace:
npm install tdm-sdk
tdm connectThis installs the TDM CLI, opens the local Dashboard, and initializes your environment.
Create a dedicated workspace for your trading agent:
tdm workspace create trading-agent
cd trading-agentTDM works with any exchange that has an HTTP API. Connect by adding the API domain to your Trust Policy allowlist:
// contour-trust-policy.json
{
"endpointAllowlist": [
// Major Exchanges
"api.binance.com/api/v3/*",
"api.binance.us/*",
"api.coinbase.com/v2/*",
"api.pro.coinbase.com/*",
"api.kraken.com/0/*",
"api.bybit.com/*",
"www.okx.com/api/v5/*",
"api.gateio.ws/api/v4/*",
// Additional Platforms
"api.bitfinex.com/v2/*",
"www.bitstamp.net/api/v2/*",
"api.gemini.com/v1/*",
"api.kucoin.com/api/v1/*",
"api.huobi.pro/v1/*",
"api.bitget.com/api/v2/*",
// Any other exchange with public API
"your-exchange-domain.com/*"
]
}Generic API Support: TDM infrastructure (budget enforcement, bounded execution) works with any HTTP API. You bring the API client, TDM enforces the limits.
Native Connectors (Coming Soon): Platform-specific plugins with optimized SDK helpers, typed interfaces, and automatic error handling will be available for major exchanges.
TDM enforces constraints through a Trust Policy that controls which plugins can execute and which API endpoints they can access:
// contour-trust-policy.json
{
// Allowed API endpoints (domain-level control)
"endpointAllowlist": [
"api.binance.com/api/v3/*",
"api.coinbase.com/v2/*"
],
// Trusted trading plugins
"trustedPluginIds": [
"tdm-trading-agent-v1"
],
// Plugin checksum verification (ensures no tampering)
"trustedPluginChecksums": {
"tdm-trading-agent-v1": "sha256:abc123..."
},
// Required plugin permissions
"allowedPluginPermissions": [
"trading:read",
"trading:execute"
],
// Signature prompt for large transactions
"signaturePromptThresholdBytes": 256,
"requireSignaturePromptForUnknownProviders": true
}Infrastructure-level enforcement: The Contour runtime blocks any plugin action that violates this policy. Agents cannot bypass these checks.
Set session budgets and spending caps that limit how much capital an agent can deploy:
// trading-budget.json
{
"budgetPolicy": {
"defaultLimitUsd": 100.00, // $100 per trading session
"requiresApprovalAboveUsd": 50.00 // Require prompt for trades > $50
},
"runtimeConstraints": {
"maxSessionBudgetUsd": 500.00, // Hard cap: $500 max per session
"subContourRequired": true, // Run in isolated sub-contour
"promptInjectionReviewRequired": true
}
}How it works: TDM issues cryptographically-signed spending caps (JWT tokens) that the infrastructure validates before every transaction. Even if the agent tries to spend more, the request is rejected at the infrastructure layer with402 BUDGET_EXCEEDED.
TDM uses a two-phase commit protocol to ensure agents never exceed budgets, even during network failures or crashes:
// Agent requests to execute $50 trade
POST /reserve
{
"requestId": "trade-123",
"estimatedCost": "50.00"
}
// Infrastructure checks:
// 1. current_spend + reserved + $50 <= session_cap?
// 2. If YES → lock $50, return reservation
// 3. If NO → return 402 BUDGET_EXCEEDEDResult: $50 is atomically reserved. Agent cannot spend this budget twice.
Agent executes trade on exchange (Binance, Coinbase, etc.)
// Report actual cost
POST /settle
{
"reservationId": "trade-123",
"actualCost": "48.50", // Actual fee was $48.50
"success": true
}
// Infrastructure actions:
// 1. Remove $50 reservation
// 2. Add $48.50 to cumulative spend
// 3. Free $1.50 back to available budgetResult: Only actual cost ($48.50) is charged. Unused budget ($1.50) freed.
If the agent crashes or network fails, reservations automatically expire after 60 seconds and budget is refunded — you're never charged for failed requests.
All sessions for a user share the same budget. This prevents parallel session attacks where an agent opens 10 tabs and tries to spend 10x the budget.
Agent detects price momentum, executes within session budget, respects stop-loss and position limits.
Automated buy/sell grid with predefined price levels, capital allocation per grid level, max total exposure.
Cross-exchange arbitrage with per-exchange capital limits, min profit threshold, max slippage tolerance.
Automated liquidity provision with max inventory limits, spread constraints, dynamic rebalancing.