OS Trading Engine
API Reference
Endpoints
Agent Transactions

Agent Transactions

View transaction history for trading agents, including buys, sells, and other on-chain activity.


Endpoints Overview

MethodEndpointDescription
GET/api/v1/agent-transactionsList transactions
GET/api/v1/agent-transactions/:idGet a specific transaction
POST/api/v1/agent-transactionsCreate a transaction record
PUT/api/v1/agent-transactions/:idUpdate a transaction
DELETE/api/v1/agent-transactions/:idDelete a transaction

All transaction endpoints require JWT authentication.


List Transactions

Get transactions for an agent with optional filtering.

GET /api/v1/agent-transactions?agentId=:agentId

Query Parameters

ParameterTypeRequiredDescription
agentIdUUIDYesAgent ID
walletAddressstringNoFilter by wallet
transactionTypestringNoFilter by type: BUY, SELL
startTimeISO 8601NoFilter from date
endTimeISO 8601NoFilter to date
signalIdintegerNoFilter by signal ID
isDcabooleanNoFilter DCA transactions
limitintegerNoMax results (default: 100, max: 1000)
offsetintegerNoSkip results (default: 0)

Response

Success (200)

[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "agentId": "123e4567-e89b-12d3-a456-426614174000",
    "walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "transactionType": "BUY",
    "transactionValueUsd": "100.00",
    "transactionTime": "2025-01-20T08:00:00.000Z",
    "destinationAddress": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
    "signalId": 12345,
    "fees": "0.002",
    "routes": ["Jupiter"],
    "inputMint": "So11111111111111111111111111111111111111112",
    "inputSymbol": "SOL",
    "inputAmount": "1.0",
    "inputPrice": "100.00",
    "outputMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
    "outputSymbol": "BONK",
    "outputAmount": "1000000",
    "outputPrice": "0.0001",
    "slippage": "300",
    "priceImpact": "0.05",
    "isDca": false,
    "createdAt": "2025-01-20T08:00:00.000Z",
    "updatedAt": "2025-01-20T08:00:00.000Z"
  }
]

Response Fields

FieldTypeDescription
idUUIDTransaction ID
agentIdUUIDAgent ID
walletAddressstringWallet that executed the transaction
transactionTypestringBUY or SELL
transactionValueUsdstringTransaction value in USD
transactionTimeISO 8601When the transaction occurred
destinationAddressstringTarget token/wallet address
signalIdintegerAssociated signal ID (if any)
feesstringTransaction fees
routesarraySwap routes used
inputMintstringInput token mint address
inputSymbolstringInput token symbol
inputAmountstringAmount of input token
inputPricestringPrice of input token
outputMintstringOutput token mint address
outputSymbolstringOutput token symbol
outputAmountstringAmount of output token
outputPricestringPrice of output token
slippagestringSlippage in basis points
priceImpactstringPrice impact percentage
isDcabooleanWhether this was a DCA order

Example

curl -X GET "https://your-instance.com/api/v1/agent-transactions?agentId=123e...&transactionType=BUY&limit=50" \
  -H "Authorization: Bearer <access_token>"

Get Transaction

Get a specific transaction by ID.

GET /api/v1/agent-transactions/:id

Path Parameters

ParameterTypeDescription
idUUIDTransaction ID

Response

Success (200)

Returns the transaction object.


Create Transaction

Create a new transaction record. Typically used internally when trades execute.

POST /api/v1/agent-transactions

Request

{
  "agentId": "123e4567-e89b-12d3-a456-426614174000",
  "walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "transactionType": "BUY",
  "transactionValueUsd": "100.00",
  "inputMint": "So11111111111111111111111111111111111111112",
  "inputAmount": "1.0",
  "outputMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
  "outputAmount": "1000000"
}

Response

Success (201)

Returns the created transaction record.


Update Transaction

Update an existing transaction record.

PUT /api/v1/agent-transactions/:id

Response

Success (200)

Returns the updated transaction record.


Delete Transaction

Delete a transaction record.

DELETE /api/v1/agent-transactions/:id

Response

Success (200)

{
  "success": true
}

Transaction Types

TypeDescription
BUYToken purchase (SOL → Token)
SELLToken sale (Token → SOL)

Related Endpoints