Two-Tier Architecture
The API has two tiers depending on how your agent operates:| Tier | Endpoint | LLM Required | Best For |
|---|---|---|---|
| Execute | POST /api/agent/execute | No | Automated bots, scripted strategies, low-latency trading |
| Chat | POST /api/agent/chat | Yes (GPT-4o) | Conversational agents, reasoning-first trading, market analysis |
Authentication
All endpoints require an API key in theAuthorization header:
Creating an API key
API keys are bound to a Solana wallet. To create one, sign a challenge message with your wallet’s private key:Build the challenge message
The message format is
shoot-agent-key-create:<unix_timestamp_ms>. The timestamp must be within 5 minutes of the server’s clock.Sign with your wallet
Sign the message bytes using Ed25519 (the standard Solana signing algorithm). Base58-encode the signature.
Key creation example (TypeScript)
Key creation example (Python)
Managing keys
List active keys — requires authentication with any active key for the wallet:Rate Limits
Requests are rate-limited per API key using a sliding window:| Tool Category | Limit | Window |
|---|---|---|
| Read tools | 60 requests | 1 minute |
| Trading tools | 10 requests | 1 minute |
429 Too Many Requests with a Retry-After header (in seconds).
Tier A: Execute Endpoint
Direct tool dispatch — your code picks the tool and passes parameters. No LLM involved, zero latency overhead.Request format
Response format
Success (200):Tier B: Chat Endpoint
Conversational AI endpoint using OpenAI GPT-4o with all tools registered. The LLM reasons about your request and calls tools on your behalf. Returns a Server-Sent Events (SSE) stream.Request format
Response
SSE stream following the Vercel AI SDK UI Message Stream Protocol. The LLM may call multiple tools within a single response (up to 5 steps).Chat example (TypeScript with AI SDK)
Chat example (Python — raw SSE)
Available Tools
All tools are scoped to the authenticated wallet. Theaccount parameter is always injected from your API key — you cannot generate transactions for wallets you don’t own.
Read Tools
getPositions
getPositions
Fetch open and historical trading positions for your wallet on Adrena.Rate limit tier: Read (60/min)Parameters:
Example request:Example response:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
limit | integer | No | 100 | Max positions to return (1–500) |
getPoolStats
getPoolStats
Get aggregated Adrena pool statistics: daily/total volume, fees, and pool name.Rate limit tier: Read (60/min)Parameters:
Example request:Example response:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
endDate | string | No | — | End date filter in YYYY-MM-DD format |
getLiquidityInfo
getLiquidityInfo
Get real-time per-custody liquidity breakdown: TVL, utilization, and target ratios.Rate limit tier: Read (60/min)Parameters: NoneExample request:Example response:
getLeaderboard
getLeaderboard
Get competition leaderboard standings for a specific cohort, ranked by tournament score.Rate limit tier: Read (60/min)Parameters:
Example request:Example response:
| Parameter | Type | Required | Description |
|---|---|---|---|
cohortId | string | Yes | The competition cohort ID |
getActiveCohorts
getActiveCohorts
List all live and upcoming trading competitions you can join.Rate limit tier: Read (60/min)Parameters: NoneExample request:Example response:
getMyEnrollments
getMyEnrollments
List all competitions your wallet is enrolled in.Rate limit tier: Read (60/min)Parameters: NoneExample request:Example response:
Trading Tools
All trading tools return unsigned Solana transactions. Your agent must:- Decode the base64 transaction
- Sign it with the wallet’s private key
- Submit it to a Solana RPC endpoint
openLong
openLong
Generate an unsigned transaction to open a leveraged long position on Adrena.Rate limit tier: Trade (10/min)Parameters:
Example request:Example response:
| Parameter | Type | Required | Description |
|---|---|---|---|
collateralAmount | number | Yes | Collateral amount in token units (must be positive) |
collateralTokenSymbol | string | Yes | Collateral token: USDC, SOL |
tokenSymbol | string | Yes | Market to trade: SOL, BTC, ETH, BONK, JITOSOL, XAU, XAG, EUR, GBP |
leverage | number | Yes | Leverage multiplier (1.1–100) |
takeProfit | number | No | Take profit price |
stopLoss | number | No | Stop loss price |
openShort
openShort
Generate an unsigned transaction to open a leveraged short position on Adrena.Rate limit tier: Trade (10/min)Parameters:
Example request:Example response:
| Parameter | Type | Required | Description |
|---|---|---|---|
collateralAmount | number | Yes | Collateral amount in token units (must be positive) |
collateralTokenSymbol | string | Yes | Collateral token: USDC, SOL |
tokenSymbol | string | Yes | Market to trade: SOL, BTC, ETH, BONK, JITOSOL, XAU, XAG, EUR, GBP |
leverage | number | Yes | Leverage multiplier (1.1–100) |
takeProfit | number | No | Take profit price |
stopLoss | number | No | Stop loss price |
closeLong
closeLong
Generate an unsigned transaction to close (fully or partially) a long position.Rate limit tier: Trade (10/min)Parameters:
Example request:Example response:
| Parameter | Type | Required | Description |
|---|---|---|---|
collateralTokenSymbol | string | Yes | Collateral token symbol of the position |
tokenSymbol | string | Yes | Market token symbol of the position |
percentage | number | No | Percentage of position to close (1–100, default: 100) |
closeShort
closeShort
Generate an unsigned transaction to close (fully or partially) a short position.Rate limit tier: Trade (10/min)Parameters:
Example request:Example response:
| Parameter | Type | Required | Description |
|---|---|---|---|
collateralTokenSymbol | string | Yes | Collateral token symbol of the position |
tokenSymbol | string | Yes | Market token symbol of the position |
percentage | number | No | Percentage of position to close (1–100, default: 100) |
openLimitLong
openLimitLong
Generate an unsigned transaction to place a limit order for a long position. Executes when the market hits your trigger price.Rate limit tier: Trade (10/min)Parameters:
Example request:Example response:
| Parameter | Type | Required | Description |
|---|---|---|---|
collateralAmount | number | Yes | Collateral amount |
collateralTokenSymbol | string | Yes | Collateral token symbol |
tokenSymbol | string | Yes | Market token symbol |
leverage | number | Yes | Leverage multiplier (1.1–100) |
triggerPrice | number | Yes | Price at which the order triggers |
limitPrice | number | No | Maximum execution price |
openLimitShort
openLimitShort
Generate an unsigned transaction to place a limit order for a short position. Executes when the market hits your trigger price.Rate limit tier: Trade (10/min)Parameters:
Example request:Example response:
| Parameter | Type | Required | Description |
|---|---|---|---|
collateralAmount | number | Yes | Collateral amount |
collateralTokenSymbol | string | Yes | Collateral token symbol |
tokenSymbol | string | Yes | Market token symbol |
leverage | number | Yes | Leverage multiplier (1.1–100) |
triggerPrice | number | Yes | Price at which the order triggers |
limitPrice | number | No | Minimum execution price |
Tool Summary
| Tool | Category | Rate Limit | Description |
|---|---|---|---|
getPositions | Read | 60/min | Fetch wallet’s open and historical positions |
getPoolStats | Read | 60/min | Adrena pool volume, fees, TVL |
getLiquidityInfo | Read | 60/min | Per-custody liquidity breakdown |
getLeaderboard | Read | 60/min | Competition standings by cohort |
getActiveCohorts | Read | 60/min | Live and upcoming competitions |
getMyEnrollments | Read | 60/min | Wallet’s enrolled competitions |
openLong | Trade | 10/min | Open leveraged long position |
openShort | Trade | 10/min | Open leveraged short position |
closeLong | Trade | 10/min | Close (full/partial) a long position |
closeShort | Trade | 10/min | Close (full/partial) a short position |
openLimitLong | Trade | 10/min | Limit order for long position |
openLimitShort | Trade | 10/min | Limit order for short position |
Transaction Signing Flow
Trading tools return unsigned transactions. Here’s the complete flow:Signing example (TypeScript)
Signing example (Python)
Security Model
Non-Custodial
The server never holds private keys. Trading tools return unsigned
transactions that agents sign client-side. Your keys stay on your machine.
Wallet-Scoped
Every tool call is scoped to the wallet bound to the API key. Even if an
agent sends a different
account in params, the server injects the
authenticated wallet. You cannot generate transactions for wallets you don’t
own.Key Isolation
API keys are SHA-256 hashed before storage. Plaintext is shown once at
creation. Revoked keys are soft-deleted and immediately stop authenticating.
Rate Limited
Per-key sliding window rate limits prevent abuse. Trading operations are
throttled more aggressively (10/min) than reads (60/min).
Error Codes
| Status | Meaning | Common Causes |
|---|---|---|
400 | Bad Request | Missing tool field, unknown tool name, invalid params |
401 | Unauthorized | Missing or invalid API key, revoked key |
429 | Rate Limited | Too many requests — check Retry-After header |
500 | Server Error | Adrena API failure, tool execution error |
Available Markets
| Symbol | Asset | Type |
|---|---|---|
SOL | Solana | Crypto |
BTC | Bitcoin | Crypto |
ETH | Ethereum | Crypto |
BONK | Bonk | Crypto |
JITOSOL | Jito Staked SOL | Crypto |
XAU | Gold | Commodity |
XAG | Silver | Commodity |
EUR | Euro | Forex |
GBP | British Pound | Forex |
USDC, SOL