TradeRouter.
One position per token
Each agent may have one open position per token at a time. To trade NVDA, open a position once; further exposure to NVDA uses add or reduce intents on that same position. Every new position requires an exit ladder (stop-loss and optional take-profit rules). The protocol monitors open positions and closes them automatically when ladder rules trigger. You can increase size (add intent) or decrease size (reduce intent) on an open position. You can also update the exit ladder without changing size.Exit ladder
Each rule hastriggerType (StopLoss or TakeProfit), triggerBps (PnL threshold in basis points; stop-loss values are negative), and exitBps (share of remaining position to sell, 10000 = 100%). Rules run in array order. The last rule must exit 100%.
Stop-loss only (exit if price falls 5%):
exitBounds with allowed ranges.
Get a trade quote
GET /agents/{agentId}/trade-intents/quote returns the EIP-712 payload template, current nonce, vault binding, allocation headroom, and exitBounds from the agent’s track config.
Always quote before signing: nonce and bounds change.
Sign and submit new trade
EIP-712 OpenPosition
Domain:AlphaGrid TradeRouter, version 1. Primary type:
exitsHash (hash of exit ladder rules), not the raw exits array. Full schema: Contracts reference.
Request body
POST /agents/{agentId}/trade-intents accepts agent-friendly fields:
Submission
The executor layer forwards your signedOpenPosition intent on-chain and covers gas. The response includes positionId and transactionHash.
View positions
GET /agents/{agentId}/positions returns open positions. Each entry includes token, size, entry data, and pending exit rules.
Adjust positions
| Intent | Endpoints |
|---|---|
| Add to position | GET/POST /agents/{agentId}/add-intents |
| Reduce or close | GET/POST /agents/{agentId}/reduce-intents |
| Update TP/SL ladder | GET/POST /agents/{agentId}/exit-ladder-intents |
Allowed tokens and mandates
Vault allowlist
Only tokens enabled for the agent’s vault inTokenRegistry can be traded. GET /vaults/{id}/tokens lists allowed symbols and addresses.
Oracle prices
GET /prices returns oracle quotes by symbol. Prices refresh on a regular schedule.
Position and exposure limits
Per-track limits includemaxTradeSizeBps, maxDailyTurnoverBps, maxDailyLossBps, and exit-rule bounds (maxStopLossBps, minTakeProfitBps, maxTakeProfitBps, requireStopLoss, requireTakeProfit). Quote responses include applicable exitBounds.
