Operations
Base: /api/v1/operations
Request bodies that include userId expect your external user id—the id your client uses to identify that user in your own system (for example client-user-001). See Users — Identity model.
Deposits and transaction history
POST /getHistoryPaginatedPOST /getProfitsHistoryPOST /getClaimHistoryPOST /getDepositsPOST /getDepositPOST /getDepositByTokenPOST /depositsPOST /depositTokensPOST /bulkDepositTokensPOST /retryDepositPOST /cancelDepositPOST /depositAndCreateStrategyPOST /getDepositAndCreateStrategyStatus
Routes marked 2FA require integration two-factor authentication; otherwise the API returns 403.
| Route | 2FA |
|---|---|
deposits, depositTokens, bulkDepositTokens, retryDeposit, cancelDeposit, depositAndCreateStrategy | Yes |
Read routes (getClaimHistory, getDepositAndCreateStrategyStatus, etc.) | No |
depositAndCreateStrategy returns a processId — poll getDepositAndCreateStrategyStatus until the combined deposit-and-strategy job completes or fails.
Optional on deposit destination routes: tokenAddress (expected token) and isNative. depositTokens / bulk items also accept chainType (EVM | SOLANA, default EVM); chainId is required for Solana.
Withdraws
POST /getWithdrawsPOST /getWithdrawPOST /withdrawTokens
/withdrawTokens requires 2FA setup and can return 403.
withdrawTokens.amount is human-readable amount (not raw smallest-unit amount).
Swaps
POST /getEvmQuotePOST /getSolQuotePOST /executeSwapPOST /getSwapHistoryPOST /getSwapStatus
/executeSwap requires 2FA setup and can return 403. Quote routes require API key/secret only.
executeSwap.amount is raw amount in smallest unit (for example, 6-decimal token: 25 -> "25000000").
Optional on executeSwap: routeProtection (reject quotes beyond oracle deviation threshold, default 7% for swaps). On Solana, optional routerKind (jupiter, titan, or pool); when routerKind is pool, also send poolKind (raydium, meteora, pumpswap) and poolAddress.
getEvmQuote: EVM chains (1, 8453, 56, 4663). Provide amountIn (exact-in) or amountOut (exact-out; not supported on Robinhood 4663). Optional slippagePercentage (default 2). Results cached ~7s.
getSolQuote: Solana (1399811149). Requires amountIn. Optionally pass poolAddress + poolKind to price a specific pool. Returns Jupiter/Titan (and optional pool) legs plus best router.
Endpoint Examples
POST /operations/getHistoryPaginated
POST /operations/getHistoryPaginatedExample response (HistoryPaginatedResponse)
{
"history": [
{
"id": 501,
"type": "buy",
"amount": "25000000",
"amountInUSD": "25.00",
"transactionHash": "0xabc123def456",
"createdAt": "2026-03-20T11:22:33.000Z",
"chainId": 8453,
"tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"symbol": "USDC",
"strategyId": 1
}
],
"numberOfPages": 1,
"currentPage": 1,
"count": 1
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getHistoryPaginated" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","page":1,"pageSize":20,"type":"all","chainId":8453}'POST /operations/getProfitsHistory
POST /operations/getProfitsHistoryExample response (ProfitsHistoryResponse)
[
{
"id": 321,
"amount": "125.0000",
"chainId": 8453,
"type": "sell",
"createdAt": "2026-03-24T08:42:01.000Z",
"updatedAt": "2026-03-24T08:42:01.000Z",
"pool": {
"name": "Wrapped Ether",
"symbol": "WETH",
"tokenPrice": "2800.12",
"decimals": 18,
"chainId": 8453
},
"value": "350015.0000",
"nativeValue": "125.0000"
}
]curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getProfitsHistory" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","chainId":56}'POST /operations/getClaimHistory
POST /operations/getClaimHistoryReturns claim/withdraw Transaction records for the user (type: "withdraw"), newest first.
Example response (ClaimHistoryResponse)
[
{
"id": 901,
"type": "withdraw",
"amount": "5000000",
"hash": "0xclaimhash123",
"chainId": 8453,
"status": "completed",
"createdAt": "2026-03-22T09:30:00.000Z",
"updatedAt": "2026-03-22T09:31:00.000Z"
}
]curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getClaimHistory" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001"}'POST /operations/getDeposits
POST /operations/getDepositsExample response (PaginatedResponse<Deposit>)
{
"data": [
{
"depositId": 1,
"userId": "client-user-001",
"chainId": 8453,
"tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"amount": "100000000",
"userBalance": "100000000",
"status": "active"
}
],
"total": 1,
"skip": 0,
"limit": 20
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getDeposits" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","chainId":8453,"skip":0,"limit":20}'POST /operations/getDeposit
POST /operations/getDepositExample response (Deposit)
{
"depositId": 1,
"userId": "client-user-001",
"chainId": 8453,
"tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"amount": "100000000",
"userBalance": "100000000",
"status": "active"
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getDeposit" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","depositId":1}'POST /operations/getDepositByToken
POST /operations/getDepositByTokenExample response (Deposit)
{
"depositId": 1,
"userId": "client-user-001",
"chainId": 8453,
"tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"amount": "100000000",
"userBalance": "100000000",
"status": "active"
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getDepositByToken" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","tokenAddress":"So11111111111111111111111111111111111111112","chainId":1399811149}'POST /operations/deposits
POST /operations/depositscurl
curl -X POST "https://partners.sonar.trade/api/v1/operations/deposits" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","chainId":8453,"tokenAddress":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"}'POST /operations/depositTokens
POST /operations/depositTokensRequires 2FA. Optional chainId, chainType, tokenAddress, isNative. For Solana, send chainType: "SOLANA" and chainId.
curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/depositTokens" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","chainId":56,"tokenAddress":"0x55d398326f99059ff775485246999027b3197955"}'POST /operations/bulkDepositTokens
POST /operations/bulkDepositTokensRequires 2FA. Create up to 50 one-time deposit destinations in one request. Response includes bulkId, deposits, and per-item errors.
Example response (BulkDepositTokensResult)
{
"isBulk": true,
"bulkId": "bulk_7f3a2c1d",
"deposits": [
{
"depositId": 10,
"userId": "client-user-001",
"chainId": 8453,
"status": "active"
},
{
"depositId": 11,
"userId": "client-user-001",
"chainId": 56,
"status": "active"
}
],
"errors": [],
"totalRequested": 2,
"totalCreated": 2
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/bulkDepositTokens" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","deposits":[{"chainId":8453},{"chainId":56,"tokenAddress":"0x55d398326f99059ff775485246999027b3197955"}]}'POST /operations/retryDeposit
POST /operations/retryDepositRequires 2FA. Re-queue deposit processing for a depositAddress. Optionally pass txHash and logIndex to reprocess a specific transfer.
curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/retryDeposit" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","depositAddress":"0xDepositAddressExample","chainId":8453,"txHash":"0xabc123"}'POST /operations/cancelDeposit
POST /operations/cancelDepositRequires 2FA. Cancel a pending deposit by depositId. Cannot cancel completed, failed, or already-cancelled deposits.
curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/cancelDeposit" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","depositId":42}'POST /operations/depositAndCreateStrategy
POST /operations/depositAndCreateStrategyRequires 2FA. Creates a one-time deposit destination, then automatically creates a DCA or volume strategy when the deposit completes. Body fields mirror strategy create options; strategyKind is one of dcaBuy, dcaSell, volumeBuy, or volumeSell. Returns processId for status polling.
curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/depositAndCreateStrategy" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","chainId":8453,"strategyKind":"dcaBuy","strategyTokenAddress":"0x4200000000000000000000000000000000000006","balanceUsed":"100000000","inputToken":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","outputToken":"0x4200000000000000000000000000000000000006","orders":5,"dcaFrequency":60,"routeProtection":true}'POST /operations/getDepositAndCreateStrategyStatus
POST /operations/getDepositAndCreateStrategyStatusPoll combined job status by processId from depositAndCreateStrategy. When complete, strategyId is set.
Example response (DepositAndCreateStrategyStatus)
{
"status": "waiting_for_deposit",
"step": 1,
"depositId": 42,
"depositPhase": "pending",
"depositAddress": "0xDepositAddressExample"
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getDepositAndCreateStrategyStatus" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","processId":"deposit-and-strategy:integration-id:client-user-001:8453:pending"}'POST /operations/getWithdraws
POST /operations/getWithdrawsExample response (PaginatedResponse<Withdrawal>)
{
"data": [
{
"withdrawId": 1,
"userId": "client-user-001",
"chainId": 56,
"amount": "10",
"receiverAddress": "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
"status": "completed",
"createdAt": "2026-03-20T12:00:00.000Z",
"updatedAt": "2026-03-20T12:01:30.000Z"
}
],
"total": 1,
"skip": 0,
"limit": 20
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getWithdraws" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","chainId":56,"skip":0,"limit":20}'POST /operations/getWithdraw
POST /operations/getWithdrawExample response (Withdrawal)
{
"withdrawId": 1,
"userId": "client-user-001",
"chainId": 56,
"amount": "10",
"receiverAddress": "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
"status": "completed",
"createdAt": "2026-03-20T12:00:00.000Z",
"updatedAt": "2026-03-20T12:01:30.000Z"
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getWithdraw" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","withdrawId":1}'POST /operations/withdrawTokens
POST /operations/withdrawTokenscurl
curl -X POST "https://partners.sonar.trade/api/v1/operations/withdrawTokens" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","receiverAddress":"0x8ba1f109551bD432803012645Ac136ddd64DBA72","tokenAddress":"0x55d398326f99059ff775485246999027b3197955","chainId":56,"amount":"10"}'POST /operations/getEvmQuote
POST /operations/getEvmQuoteNo 2FA. Provide amountIn or amountOut (exact-out not supported on chain 4663). Cached ~7s.
Example response (EvmQuoteResponse)
{
"success": true,
"amountIn": "1000000",
"amountOut": "312450000000000",
"amountOutWithFee": "314000000000000",
"minAmountOut": "306201000000000",
"tokenIn": {
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"decimals": 6,
"symbol": "USDC"
},
"tokenOut": {
"address": "0x4200000000000000000000000000000000000006",
"decimals": 18,
"symbol": "WETH"
}
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getEvmQuote" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"chainId":8453,"tokenIn":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","tokenOut":"0x4200000000000000000000000000000000000006","amountIn":"1000000","slippagePercentage":2}'POST /operations/getSolQuote
POST /operations/getSolQuoteNo 2FA. Requires amountIn. Optional poolAddress + poolKind for a specific pool. Cached ~7s.
Example response (SolQuoteResponse)
{
"bestRouter": "jupiter",
"bestAmountOut": "998765432",
"bestAmountOutWithFee": "1003765432",
"jupiter": {
"outAmount": "998765432",
"amountOutWithFee": "1003765432"
},
"titan": {
"outAmount": "997500000",
"amountOutWithFee": "1002500000"
},
"tokenIn": {
"address": "Es9vMFrzaCERmJfrF4H2TUN324j6nU5zThTcACLqx4pX",
"decimals": 6,
"symbol": "USDC"
},
"tokenOut": {
"address": "So11111111111111111111111111111111111111112",
"decimals": 9,
"symbol": "SOL"
}
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getSolQuote" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"chainId":1399811149,"tokenIn":"Es9vMFrzaCERmJfrF4H2TUN324j6nU5zThTcACLqx4pX","tokenOut":"So11111111111111111111111111111111111111112","amountIn":"1000000"}'POST /operations/executeSwap
POST /operations/executeSwapOptional routeProtection. On Solana, optional routerKind with poolKind and poolAddress when routing through a specific pool.
curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/executeSwap" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","type":"buy","amount":"25000000","chainId":1399811149,"tokenIn":"Es9vMFrzaCERmJfrF4H2TUN324j6nU5zThTcACLqx4pX","tokenOut":"So11111111111111111111111111111111111111112","routeProtection":true,"routerKind":"jupiter"}'POST /operations/getSwapHistory
POST /operations/getSwapHistoryExample response (SwapHistoryItem[])
[
{
"id": 77,
"swapId": "swap_abc123",
"status": "completed",
"type": "buy",
"amount": "25000000",
"chainId": 8453,
"tokenIn": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"tokenOut": "0x4200000000000000000000000000000000000006",
"transactionHash": "0xfeedbeef1234",
"createdAt": "2026-03-20T10:15:00.000Z",
"pool": {
"id": 1,
"name": "WETH",
"symbol": "WETH",
"tokenAddress": "0x4200000000000000000000000000000000000006",
"decimals": 18
},
"Transaction": {
"hash": "0xfeedbeef1234"
}
}
]curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getSwapHistory" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","chainId":8453}'POST /operations/getSwapStatus
POST /operations/getSwapStatusExample response (SwapStatus)
{
"status": "completed",
"swapId": "swap_abc123",
"message": "Swap executed successfully"
}curl
curl -X POST "https://partners.sonar.trade/api/v1/operations/getSwapStatus" \
-H "Content-Type: application/json" \
-H "X-API-Key: <API_KEY>" \
-H "X-API-Secret: <API_SECRET>" \
-d '{"userId":"client-user-001","swapId":"swap_abc123"}'Async behavior
- Some routes enqueue work (swap, withdraw, deposit creation,
depositAndCreateStrategy). - Keep returned ids (
swapId,depositId,withdrawId,processId,bulkId) and query status/history routes. - For
depositAndCreateStrategy, pollgetDepositAndCreateStrategyStatusuntilstatusis terminal (completedorfailed).
Typical status codes
200or201: success400: validation error, business rule error, or insufficient balance401: invalid or missing API key/secret403: integration 2FA setup required404: user, pool, deposit, withdraw, or swap not found