API Reference
The Silhouette API and SDK are in beta. We are actively adding new operations.
This section provides detailed documentation for each available API operation. All operations use the same endpoint with different operation values in the request body. For an overview of how the API works, see the API Overview.
Public Operations
Public operations do not require a bearer token. Use these operations to authenticate, check public service metadata, and discover supported tokens and markets.
login
Authenticate with the Silhouette API using Sign-In With Ethereum (SIWE) to obtain a bearer token. This operation does not require an existing bearer token - it's the first step in using the API.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Not required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "login" |
| message | string | Yes | The SIWE message to verify. Must include the statement "Sign in with Ethereum to the app." |
| signature | string | Yes | The cryptographic signature of the SIWE message, signed with your wallet's private key |
| primaryAddress | string | No | Primary wallet address when signing with a Hyperliquid API wallet. Must be a valid EVM address (0x + 40 hex chars). When provided, Silhouette verifies the signing address is an authorized API wallet for this primary address and issues a JWT with the primary address as identity. |
Example request (direct wallet login):
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-d '{
"operation": "login",
"message": "api.silhouette.exchange wants you to sign in with your Ethereum account:\n0x1234567890123456789012345678901234567890\n\nSign in with Ethereum to the app.\n\nURI: https://api.silhouette.exchange/login\nVersion: 1\nChain ID: 1\nNonce: abcdefghijklmnopqrstuvwxyz123456\nIssued At: 2024-01-15T10:30:00.000Z",
"signature": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890ab"
}'
Example request (API wallet login):
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-d '{
"operation": "login",
"message": "api.silhouette.exchange wants you to sign in with your Ethereum account:\n0xAPI_WALLET_ADDRESS\n\nSign in with Ethereum to the app.\n\nURI: https://api.silhouette.exchange/login\nVersion: 1\nChain ID: 1\nNonce: abcdefghijklmnopqrstuvwxyz123456\nIssued At: 2024-01-15T10:30:00.000Z",
"signature": "0x_SIGNATURE_FROM_API_WALLET",
"primaryAddress": "0xYOUR_MAIN_WALLET_ADDRESS"
}'
Success response:
{
"operation": "login",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHgxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwIiwiY2hhaW5JZCI6MSwiaWF0IjoxNzA1MzEzNDAwLCJleHAiOjE3MDUzMTcwMDB9.signature_here",
"responseMetadata": {
"timestamp": 1705313400,
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
Error responses:
{
"operation": "login",
"error": "Message and signature are required",
"code": "INVALID_INPUT",
"responseMetadata": {
"timestamp": 1705313400
}
}
{
"operation": "login",
"error": "Invalid signature",
"code": "INVALID_SIGNATURE",
"responseMetadata": {
"timestamp": 1705313400
}
}
{
"operation": "login",
"error": "Invalid statement",
"code": "INVALID_STATEMENT",
"responseMetadata": {
"timestamp": 1705313400
}
}
Notes:
- The SIWE message must include the exact statement "Sign in with Ethereum to the app." (case-sensitive)
- The signature must be generated by signing the SIWE message with the private key corresponding to the address in the message
- The returned JWT token expires after 24 hours
- Store the token securely - you'll need to include it in the
Authorizationheader for all subsequent API requests - If your token expires, simply call this operation again to obtain a new token
- You can use the login assistant for a simplified authentication flow
- API wallet login: If you provide a
primaryAddress, the SIWE message must be signed by an API wallet authorized for that primary address. The returned JWT will contain theprimaryAddress, so all downstream operations work the same as a direct login. See Authentication for details.
Related operations: This operation is prerequisite for private user-scoped operations such as getBalances, createOrder, and withdrawals.
getTokens
Retrieve metadata for all tokens currently supported by the API. This is a public discovery operation; use it instead of hardcoding token metadata in your integration.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Not required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "getTokens" |
Example request:
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-d '{
"operation": "getTokens"
}'
Success response:
{
"operation": "getTokens",
"tokens": [
{
"name": "USDC",
"fullName": null,
"index": 0,
"tokenId": "0x6d1e7cde53ba9467b783cb7c530ce054",
"szDecimals": 8,
"weiDecimals": 8,
"isCanonical": true,
"evmContract": {
"address": "0x6b9e773128f453f5c2c60935ee2de2cbc5390a24",
"evm_extra_wei_decimals": -2
}
},
{
"name": "HYPE",
"fullName": "Hyperliquid",
"index": 150,
"tokenId": "0x0d01dc56dcaaca66ad901c959b4011ec",
"szDecimals": 2,
"weiDecimals": 8,
"isCanonical": false,
"evmContract": null
}
],
"responseMetadata": {
"timestamp": 1704067200000,
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
Response fields:
| Field | Type | Description |
|---|---|---|
| tokens | array | Supported token metadata records |
| tokens[].name | string | Token symbol used in API requests, balances, orders, and withdrawals |
| tokens[].fullName | string | null | Full token name, when available |
| tokens[].index | number | Hyperliquid spot token index |
| tokens[].tokenId | string | Hyperliquid token ID as a hex string |
| tokens[].szDecimals | number | Decimal precision for order sizes |
| tokens[].weiDecimals | number | Decimal precision for the token's smallest unit |
| tokens[].isCanonical | boolean | Whether the token is canonical on Hyperliquid |
| tokens[].evmContract | object | null | EVM contract metadata, when available |
| tokens[].evmContract.address | string | EVM contract address |
| tokens[].evmContract.evm_extra_wei_decimals | number | Additional EVM decimal adjustment for the contract |
Error responses:
{
"operation": "getTokens",
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"responseMetadata": {
"timestamp": 1704067200000
}
}
Notes:
- This operation is public; do not include an
Authorizationheader unless your client adds one globally - The supported token set can vary by environment and may change over time
- Use
nameas the token symbol forbaseToken,quoteToken, andtokenSymbolfields - Use
getMarketsto discover which token pairs are currently enabled for trading
Related operations: Use getMarkets to discover supported trading pairs, getBalances to view your balances, and createOrder to trade supported tokens.
getMarkets
Retrieve metadata for all trading pairs currently supported by the API. This is a public discovery operation; use it to validate baseToken and quoteToken values before creating orders.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Not required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "getMarkets" |
Example request:
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-d '{
"operation": "getMarkets"
}'
Success response:
{
"operation": "getMarkets",
"markets": [
{
"name": "HYPE/USDC",
"baseToken": "HYPE",
"quoteToken": "USDC",
"baseTokenIndex": 150,
"quoteTokenIndex": 0
},
{
"name": "HYPE/USDH",
"baseToken": "HYPE",
"quoteToken": "USDH",
"baseTokenIndex": 150,
"quoteTokenIndex": 360
}
],
"responseMetadata": {
"timestamp": 1704067200000,
"requestId": "650e8400-e29b-41d4-a716-446655440001"
}
}
Response fields:
| Field | Type | Description |
|---|---|---|
| markets | array | Supported trading-pair metadata records |
| markets[].name | string | Market pair name in BASE/QUOTE format |
| markets[].baseToken | string | Base token symbol for the pair |
| markets[].quoteToken | string | Quote token symbol for the pair |
| markets[].baseTokenIndex | number | Hyperliquid spot token index for the base token |
| markets[].quoteTokenIndex | number | Hyperliquid spot token index for the quote token |
Error responses:
{
"operation": "getMarkets",
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"responseMetadata": {
"timestamp": 1704067200000
}
}
Notes:
- This operation is public; do not include an
Authorizationheader unless your client adds one globally - The supported market set can vary by environment and may change over time
- The
namefield is informational; passbaseTokenandquoteTokenseparately when callingcreateOrder - Markets with unavailable token metadata are excluded from the response
Related operations: Use getTokens for token-level metadata and createOrder to place an order on a supported market.
Authenticated Operations
Authenticated operations require a bearer token in the Authorization header and return or modify state scoped to the authenticated user.
getBalances
Retrieve your account balance information for all tokens. This shows your available balance (funds you can trade or withdraw), locked balance (funds tied up in open orders), and total balance.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "getBalances" |
Example request:
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "getBalances"
}'
Success response:
{
"operation": "getBalances",
"balances": [
{
"token": "USDC",
"available": "1000000000",
"availableFloat": "1000.0",
"locked": "250000000",
"lockedFloat": "250.0",
"total": "1250000000",
"totalFloat": "1250.0"
}
],
"responseMetadata": {
"timestamp": 1705313400,
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
Response fields:
| Field | Type | Description |
|---|---|---|
| token | string | The token symbol (e.g., "USDC") |
| available | string | Available balance in the token's smallest unit (can be used for trading or withdrawal) |
| availableFloat | string | Available balance as a human-readable decimal number |
| locked | string | Balance locked in open orders, in the token's smallest unit |
| lockedFloat | string | Locked balance as a human-readable decimal number |
| total | string | Total balance (available + locked), in the token's smallest unit |
| totalFloat | string | Total balance as a human-readable decimal number |
Error responses:
{
"operation": "getBalances",
"error": "User 0x1234567890123456789012345678901234567890 not found",
"code": "USER_NOT_FOUND",
"responseMetadata": {
"timestamp": 1705313400
}
}
{
"operation": "getBalances",
"error": "Failed to retrieve balances",
"code": "INTERNAL_ERROR",
"responseMetadata": {
"timestamp": 1705313400
}
}
Notes:
- Balance values are represented in two formats: raw strings in the token's smallest unit (e.g., micro-USDC for USDC) and human-readable float strings
- For USDC, the smallest unit is micro-USDC, so
"1000000000"represents 1,000 USDC - The
lockedfield shows funds currently reserved in open orders and unavailable for new trades or withdrawals - The
availablefield shows funds you can immediately use for trading or withdrawal - If you have no balance for a token, it won't appear in the response array
- This operation requires authentication - include your bearer token in the
Authorizationheader
Related operations: Use createOrder to trade with your available balance, or initiateWithdrawal to withdraw available funds.
getFees
Retrieve the spot maker and taker fee rates for the authenticated user.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "getFees" |
Example request:
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "getFees"
}'
Success response:
{
"operation": "getFees",
"fees": {
"spot": {
"takerRate": "0.000700",
"makerRate": "0.000200",
"takerRatePpm": "700",
"makerRatePpm": "200"
}
},
"responseMetadata": {
"timestamp": 1704067200000,
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
Response fields:
| Field | Type | Description |
|---|---|---|
| fees.spot.takerRate | string | Spot taker fee as a decimal fraction. For example, "0.000700" is 0.07%. |
| fees.spot.makerRate | string | Spot maker fee as a decimal fraction. For example, "0.000200" is 0.02%. |
| fees.spot.takerRatePpm | string | Spot taker fee in parts per million |
| fees.spot.makerRatePpm | string | Spot maker fee in parts per million |
Error responses:
{
"operation": "getFees",
"error": "Unauthorized",
"code": "UNAUTHORIZED",
"responseMetadata": {
"timestamp": 1704067200000
}
}
Notes:
- Fee rates are scoped to the authenticated user
- Decimal rate fields are strings for exact transport and display
- PPM fields are integer strings; for example,
"700"means 700 parts per million, or 0.07%
Related operations: Use createOrder to place orders that use these fee rates.
createOrder
Create a new spot order to buy or sell tokens. All orders require an explicit price and are submitted to Hyperliquid as IOC (Immediate or Cancel) orders.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "createOrder" |
| side | string | Yes | Order side: "buy" or "sell" |
| orderType | string | Yes | Order type: "limit" or "market" |
| baseToken | string | Yes | The base token for the trading pair. The live supported set varies by environment; use getMarkets for discovery. |
| quoteToken | string | Yes | The quote token for the trading pair. The live supported set varies by environment; use getMarkets for discovery. |
| amount | string | Yes | Order amount as a human-readable decimal string (e.g., "100" or "100.5") |
| price | string | Yes | Order price as a human-readable decimal string. |
Example request (limit order):
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "createOrder",
"side": "buy",
"orderType": "limit",
"baseToken": "HYPE",
"quoteToken": "USDC",
"amount": "100.0",
"price": "1.25"
}'
Example request (market order):
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "createOrder",
"side": "sell",
"orderType": "market",
"baseToken": "HYPE",
"quoteToken": "USDC",
"amount": "50.0",
"price": "1.18"
}'
Success response:
{
"operation": "createOrder",
"message": "Order created successfully.",
"orderId": "550e8400-e29b-41d4-a716-446655440000",
"responseMetadata": {
"timestamp": 1705313400,
"requestId": "650e8400-e29b-41d4-a716-446655440001"
}
}
Error responses:
{
"operation": "createOrder",
"error": "Missing required fields: side, orderType, baseToken, quoteToken, and amount are required.",
"code": "VALIDATION_ERROR",
"responseMetadata": {
"timestamp": 1705313400
}
}
{
"operation": "createOrder",
"error": "Invalid orderType. Must be 'limit' or 'market'.",
"code": "VALIDATION_ERROR",
"responseMetadata": {
"timestamp": 1705313400
}
}
{
"operation": "createOrder",
"error": "Failed to create order.",
"code": "ORDER_ERROR",
"responseMetadata": {
"timestamp": 1705313400
}
}
Notes:
-
Order types:
"limit": Order executes at the specified price or better. Requires thepriceparameter."market": Order executes immediately at the best available price. Thepriceparameter is ignored.
-
Side:
"buy": Purchase the base token using the quote token"sell": Sell the base token for the quote token
-
Tokens and markets: Use
getTokensandgetMarketsto discover the currently enabled assets and pairs. -
Amount format: Must be a human-readable decimal string (e.g.,
"100"or"100.5"). Values are automatically scaled to the token's smallest unit. Do not send pre-scaled values. -
Price format: Must be a human-readable decimal string (e.g.,
"1.25"). Values are automatically scaled. -
Insufficient balance: The order will fail if you don't have sufficient available balance of the required token
-
Save the returned
orderIdto track the order or correlate it with delegated-order records later.
Related operations: Use listDelegatedOrders to view your orders, and getBalances to check available funds.
cancelOrder
Cancel an open order for the authenticated user. Currently only GTC limit orders support cancellation.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "cancelOrder" |
| orderId | string | Yes | The orderId returned by createOrder for the cancellable limit order. Must be a 0x-prefixed 32-character hex string. |
Example request:
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "cancelOrder",
"orderId": "0x1234567890abcdef1234567890abcdef"
}'
Success response:
{
"operation": "cancelOrder",
"message": "Order canceled successfully.",
"orderId": "0x1234567890abcdef1234567890abcdef",
"responseMetadata": {
"timestamp": 1704067200000,
"requestId": "650e8400-e29b-41d4-a716-446655440001"
}
}
Response fields:
| Field | Type | Description |
|---|---|---|
| message | string | Cancellation result message |
| orderId | string | Cancelled order ID |
Error responses:
{
"operation": "cancelOrder",
"error": "Missing required field: orderId.",
"code": "VALIDATION_ERROR",
"responseMetadata": {
"timestamp": 1704067200000
}
}
{
"operation": "cancelOrder",
"error": "Invalid orderId format. Expected a 0x-prefixed 32-character hex string.",
"code": "VALIDATION_ERROR",
"responseMetadata": {
"timestamp": 1704067200000
}
}
{
"operation": "cancelOrder",
"error": "Failed to cancel order.",
"code": "ORDER_ERROR",
"responseMetadata": {
"timestamp": 1704067200000
}
}
Notes:
cancelOrderis for cancellable GTC limit orders- Use the
orderIdreturned bycreateOrder. Do not pass a delegated-order ID such asdord_... - IOC orders normally fill or cancel immediately and are not cancellable through this operation
Related operations: Use createOrder to place orders and delegated-order operations to inspect delegated-order records.
listDelegatedOrders
Retrieve a paginated list of delegated orders for the authenticated user, optionally filtered by status, order type, or creation time. This is the primary way to enumerate orders placed on your behalf via createOrder.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "listDelegatedOrders" |
| status | string | No | Filter orders by status: "pending", "open", "filled", "partially_filled", "cancelled", "expired", or "failed" |
| orderType | string | No | Filter orders by order type: "limit" or "market" |
| createdAfter | number | No | Unix timestamp in milliseconds. Only return orders created after this time. |
| createdBefore | number | No | Unix timestamp in milliseconds. Only return orders created before this time. |
| limit | number | No | Maximum orders to return, from 1 to 100 |
| cursor | string | No | Pagination cursor returned by a previous response |
Example request (all orders):
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "listDelegatedOrders"
}'
Example request (filtered and paginated):
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "listDelegatedOrders",
"status": "open",
"orderType": "limit",
"limit": 50
}'
Success response:
{
"operation": "listDelegatedOrders",
"orders": [
{
"orderId": "dord_1234567890abcdef",
"clientOrderId": "client_abc123",
"side": "buy",
"orderType": "limit",
"baseToken": "HYPE",
"status": "open",
"createdAt": 1704067200000
}
],
"pagination": {
"nextCursor": "eyJpZCI6ImRvcmRfMTIzNDU2Nzg5MGFiY2RlZiJ9"
},
"responseMetadata": {
"timestamp": 1704067200000
}
}
Response fields:
| Field | Type | Description |
|---|---|---|
| orders | array | Delegated-order summaries for the current page |
| orders[].orderId | string | Unique delegated-order identifier, prefixed with dord_ |
| orders[].clientOrderId | string | Client-provided order identifier, when supplied |
| orders[].side | string | Order side: "buy" or "sell" |
| orders[].orderType | string | Order type: "limit" or "market" |
| orders[].baseToken | string | Base token symbol |
| orders[].status | string | Current order status |
| orders[].createdAt | number | Unix timestamp (milliseconds) when the order was created |
| pagination.nextCursor | string | Cursor to pass as cursor on the next request to fetch the following page. Absent on the final page. |
Notes:
- Results are returned in reverse chronological order (newest first)
- To retrieve full order detail, call
getDelegatedOrderwith a singleorderIdorbatchGetDelegatedOrderswith multiple IDs - Only orders belonging to the authenticated user are returned
Related operations: Use getDelegatedOrder or batchGetDelegatedOrders to fetch full detail, and createOrder to place new orders.
getDelegatedOrder
Retrieve full details for a single delegated order by its order ID.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "getDelegatedOrder" |
| orderId | string | Yes | Unique identifier of the delegated order, prefixed with dord_ |
Example request:
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "getDelegatedOrder",
"orderId": "dord_1234567890abcdef"
}'
Success response:
{
"operation": "getDelegatedOrder",
"order": {
"orderId": "dord_1234567890abcdef",
"side": "buy",
"orderType": "limit",
"baseToken": "HYPE",
"quoteToken": "USDC",
"amount": "100000000",
"amountFloat": "1",
"price": "4000000000",
"priceFloat": "40",
"status": "filled",
"expiry": 1704153600,
"createdAt": 1704067200000,
"updatedAt": 1704070800000,
"filledAmount": "100000000",
"remainingAmount": "0",
"averageFillPrice": "4000000000",
"clearingVenue": "hyperliquid"
},
"responseMetadata": {
"timestamp": 1704070800000
}
}
Response fields:
| Field | Type | Description |
|---|---|---|
| order.orderId | string | Unique delegated-order identifier |
| order.side | string | Order side: "buy" or "sell" |
| order.orderType | string | Order type: "limit" or "market" |
| order.baseToken | string | Base token symbol |
| order.quoteToken | string | Quote token symbol |
| order.amount | string | Base-token order amount as an exact integer string, scaled by 10^baseToken.weiDecimals |
| order.amountFloat | string | Human-readable base-token order amount convenience string |
| order.price | string | Limit price as an exact integer string, scaled by 10^8 |
| order.priceFloat | string | Human-readable limit price convenience string |
| order.status | string | Current order status |
| order.expiry | number | Order expiry as a Unix timestamp (seconds) |
| order.createdAt | number | Unix timestamp (milliseconds) when the order was created |
| order.updatedAt | number | Unix timestamp (milliseconds) when the order was last updated |
| order.filledAmount | string | Filled base-token amount as an exact integer string, scaled by 10^baseToken.weiDecimals |
| order.remainingAmount | string | Remaining unfilled base-token amount as an exact integer string, scaled by 10^baseToken.weiDecimals |
| order.averageFillPrice | string | Average execution price as an exact integer string, scaled by 10^8. Present for filled or partially_filled orders. |
| order.filledPrice | string | Deprecated legacy execution-price field. Use averageFillPrice instead. |
| order.clearingVenue | string | Venue where the order is executed (currently always "hyperliquid") |
Error responses:
{
"operation": "getDelegatedOrder",
"error": "Delegated order with ID 'dord_1234567890abcdef' not found for user",
"code": "NOT_FOUND",
"responseMetadata": {
"timestamp": 1705313400
}
}
Notes:
- You can only retrieve delegated orders that belong to the authenticated user. Looking up another user's order returns
NOT_FOUND - To retrieve several orders in a single request, use
batchGetDelegatedOrders - Delegated-order amounts and prices are returned as exact integer strings to preserve precision. For accounting-sensitive logic, parse these fields as arbitrary-precision integers, such as JavaScript
BigInt, and apply the documented scale when formatting values for display. amount,filledAmount, andremainingAmountare base-token amounts scaled by10^baseToken.weiDecimals. GetweiDecimalsfrom the public unauthenticatedgetTokensoperation.priceandaverageFillPriceare price fields scaled by10^8. To convert to a decimal price, divide by100,000,000.amountFloatandpriceFloatare convenience strings for display. Use the exact integer string fields for accounting-sensitive logic.- Example: If
baseToken = HYPEandHYPE.weiDecimals = 8, thenfilledAmount = "100000000"means 1.0 HYPE,remainingAmount = "50000000"means 0.5 HYPE, andaverageFillPrice = "4000000000"means 40.0 quote tokens per 1 base token. filledPriceis deprecated in delegated-order detail responses. UseaverageFillPriceinstead.
Related operations: Use listDelegatedOrders to enumerate orders, and batchGetDelegatedOrders to fetch multiple orders in one call.
batchGetDelegatedOrders
Retrieve full details for up to 100 delegated orders in a single request.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "batchGetDelegatedOrders" |
| orderIds | array of strings | Yes | Delegated-order IDs to retrieve. Between 1 and 100 entries. |
Example request:
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "batchGetDelegatedOrders",
"orderIds": [
"dord_1234567890abcdef",
"dord_fedcba0987654321"
]
}'
Success response:
{
"operation": "batchGetDelegatedOrders",
"orders": [
{
"orderId": "dord_1234567890abcdef",
"side": "buy",
"orderType": "limit",
"baseToken": "HYPE",
"quoteToken": "USDC",
"amount": "100000000",
"amountFloat": "1",
"price": "4000000000",
"priceFloat": "40",
"status": "partially_filled",
"expiry": 1704153600,
"createdAt": 1704067200000,
"updatedAt": 1704067200000,
"filledAmount": "50000000",
"remainingAmount": "50000000",
"averageFillPrice": "4000000000",
"clearingVenue": "hyperliquid"
}
],
"notFound": [
"dord_fedcba0987654321"
],
"responseMetadata": {
"timestamp": 1704067200000
}
}
Response fields:
| Field | Type | Description |
|---|---|---|
| orders | array | Full order detail for each ID that matched an order you own. Entries use the same shape as getDelegatedOrder. |
| notFound | array of strings | Order IDs from the request that could not be resolved, either because they do not exist or do not belong to you |
Notes:
- Request up to 100
orderIdsper call - Missing or foreign orders are reported through
notFoundrather than an error, so partial results are always returned when at least one ID resolves - Delegated-order amount and price fields in
ordersuse the same exact integer string contract asgetDelegatedOrder amountFloatandpriceFloatare convenience strings for display. Use the exact integer string fields for accounting-sensitive logic.filledPriceis deprecated in delegated-order detail responses. UseaverageFillPriceinstead.
Related operations: Use listDelegatedOrders to discover order IDs, and getDelegatedOrder to fetch a single order.
getUserOrders
getUserOrders has been fully decommissioned. Use the delegated-order operations instead: listDelegatedOrders to enumerate and paginate orders, getDelegatedOrder for a single order, or batchGetDelegatedOrders to fetch multiple orders in one call.
initiateWithdrawal
Request a withdrawal of funds from your Silhouette account back to your HyperCore address. Withdrawals are processed asynchronously, and you'll receive a withdrawal ID to track the status.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "initiateWithdrawal" |
| tokenSymbol | string | Yes | The token to withdraw: "USDC" or "HYPE" |
| amount | string | Yes | Withdrawal amount as a human-readable decimal string (e.g., "100" or "100.5") |
Example request:
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "initiateWithdrawal",
"tokenSymbol": "USDC",
"amount": "500.0"
}'
Success response:
{
"operation": "initiateWithdrawal",
"message": "Withdrawal request accepted and queued for processing.",
"withdrawalId": "550e8400-e29b-41d4-a716-446655440000",
"responseMetadata": {
"timestamp": 1705313400,
"requestId": "650e8400-e29b-41d4-a716-446655440001"
}
}
Error responses:
{
"operation": "initiateWithdrawal",
"error": "Missing required fields: tokenSymbol and amount are required.",
"code": "VALIDATION_ERROR",
"responseMetadata": {
"timestamp": 1705313400
}
}
{
"operation": "initiateWithdrawal",
"error": "Invalid tokenSymbol. Must be 'USDC' or 'HYPE'.",
"code": "VALIDATION_ERROR",
"responseMetadata": {
"timestamp": 1705313400
}
}
{
"operation": "initiateWithdrawal",
"error": "A withdrawal request is already in progress for this user.",
"code": "CONFLICT",
"responseMetadata": {
"timestamp": 1705313400
}
}
{
"operation": "initiateWithdrawal",
"error": "The withdrawal service is temporarily unavailable. Please try again later.",
"code": "SERVICE_UNAVAILABLE",
"responseMetadata": {
"timestamp": 1705313400
}
}
Notes:
- Withdrawals are processed asynchronously. The API returns a
withdrawalIdimmediately, but the actual withdrawal takes time to process - You can only have one pending withdrawal at a time. Wait for your current withdrawal to complete before initiating another
- The amount must not exceed your available balance (not including locked funds in open orders)
- Amount format: Must be a human-readable decimal string (e.g.,
"100"or"100.5"). Values are automatically scaled to the token's smallest unit. Do not send pre-scaled values - Use
getWithdrawalStatuswith the returnedwithdrawalIdto track the withdrawal progress - Tokens: Currently supports
"USDC"and"HYPE"only - Funds will be sent to your HyperCore address (the address associated with your authenticated wallet)
Related operations: Use getWithdrawalStatus to check withdrawal progress, getUserWithdrawals to view all your withdrawals, and getBalances to verify available funds.
getWithdrawalStatus
Check the status of a specific withdrawal using its withdrawal ID. This shows whether the withdrawal is still pending, has completed successfully, or has failed.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "getWithdrawalStatus" |
| withdrawalId | string | Yes | The unique identifier of the withdrawal to check |
Example request:
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "getWithdrawalStatus",
"withdrawalId": "550e8400-e29b-41d4-a716-446655440000"
}'
Success response (pending):
{
"operation": "getWithdrawalStatus",
"withdrawal": {
"withdrawalId": "550e8400-e29b-41d4-a716-446655440000",
"token": "USDC",
"amount": "500000000",
"state": "pending",
"txHash": null,
"errorMessage": null,
"created_at": 1705313400000,
"updated_at": 1705313400000
},
"responseMetadata": {
"timestamp": 1705313450,
"requestId": "650e8400-e29b-41d4-a716-446655440001"
}
}
Success response (completed):
{
"operation": "getWithdrawalStatus",
"withdrawal": {
"withdrawalId": "550e8400-e29b-41d4-a716-446655440000",
"token": "USDC",
"amount": "500000000",
"state": "completed",
"txHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"errorMessage": null,
"created_at": 1705313400000,
"updated_at": 1705313500000
},
"responseMetadata": {
"timestamp": 1705313550,
"requestId": "750e8400-e29b-41d4-a716-446655440002"
}
}
Success response (failed):
{
"operation": "getWithdrawalStatus",
"withdrawal": {
"withdrawalId": "550e8400-e29b-41d4-a716-446655440000",
"token": "USDC",
"amount": "500000000",
"state": "failed",
"txHash": null,
"errorMessage": "Insufficient balance on enclave wallet",
"created_at": 1705313400000,
"updated_at": 1705313450000
},
"responseMetadata": {
"timestamp": 1705313500,
"requestId": "850e8400-e29b-41d4-a716-446655440003"
}
}
Response fields:
| Field | Type | Description |
|---|---|---|
| withdrawalId | string | Unique identifier for the withdrawal |
| token | string | The token symbol being withdrawn |
| amount | string | Withdrawal amount in the token's smallest unit |
| state | string | Withdrawal status: "pending", "completed", or "failed" |
| txHash | string | null | Transaction hash on Hyperliquid (only set when state is "completed") |
| errorMessage | string | null | Error description (only set when state is "failed") |
| created_at | number | Unix timestamp (milliseconds) when the withdrawal was created |
| updated_at | number | Unix timestamp (milliseconds) when the withdrawal was last updated |
Withdrawal states:
"pending": Withdrawal is queued and being processed"completed": Withdrawal was successful. ChecktxHashfor the transaction details"failed": Withdrawal failed. CheckerrorMessagefor the reason
Error responses:
{
"operation": "getWithdrawalStatus",
"error": "Missing or invalid withdrawalId.",
"code": "VALIDATION_ERROR",
"responseMetadata": {
"timestamp": 1705313400
}
}
{
"operation": "getWithdrawalStatus",
"error": "Withdrawal not found.",
"code": "NOT_FOUND",
"responseMetadata": {
"timestamp": 1705313400
}
}
Notes:
- You can only query your own withdrawals. Attempting to check another user's withdrawal returns
NOT_FOUND - Poll this endpoint periodically to track withdrawal progress
- When
stateis"completed", use thetxHashto verify the transaction on the Hyperliquid blockchain - When
stateis"failed", check theerrorMessageto understand why the withdrawal failed - The
withdrawalIdis returned when you callinitiateWithdrawal
Related operations: Use initiateWithdrawal to request a withdrawal, and getUserWithdrawals to view all your withdrawals.
getUserWithdrawals
Retrieve a list of all your withdrawal requests, including their current status. This provides a complete history of your withdrawals.
Endpoint: POST https://api.silhouette.exchange/v0
Authentication: Required
Request parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Must be "getUserWithdrawals" |
Example request:
curl https://api.silhouette.exchange/v0 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"operation": "getUserWithdrawals"
}'
Success response:
{
"operation": "getUserWithdrawals",
"withdrawals": [
{
"withdrawalId": "650e8400-e29b-41d4-a716-446655440001",
"token": "USDC",
"amount": "500000000",
"state": "completed",
"txHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"errorMessage": null,
"created_at": 1705313400000,
"updated_at": 1705313500000
},
{
"withdrawalId": "550e8400-e29b-41d4-a716-446655440000",
"token": "HYPE",
"amount": "100000000",
"state": "pending",
"txHash": null,
"errorMessage": null,
"created_at": 1705313200000,
"updated_at": 1705313200000
},
{
"withdrawalId": "450e8400-e29b-41d4-a716-446655440002",
"token": "USDC",
"amount": "250000000",
"state": "failed",
"txHash": null,
"errorMessage": "Insufficient balance on enclave wallet",
"created_at": 1705313000000,
"updated_at": 1705313050000
}
],
"responseMetadata": {
"timestamp": 1705313600,
"requestId": "750e8400-e29b-41d4-a716-446655440003"
}
}
Response fields:
Each withdrawal in the array has the following fields:
| Field | Type | Description |
|---|---|---|
| withdrawalId | string | Unique identifier for the withdrawal |
| token | string | The token symbol being withdrawn |
| amount | string | Withdrawal amount in the token's smallest unit |
| state | string | Withdrawal status: "pending", "completed", or "failed" |
| txHash | string | null | Transaction hash on Hyperliquid (only set when state is "completed") |
| errorMessage | string | null | Error description (only set when state is "failed") |
| created_at | number | Unix timestamp (milliseconds) when the withdrawal was created |
| updated_at | number | Unix timestamp (milliseconds) when the withdrawal was last updated |
Error responses:
{
"operation": "getUserWithdrawals",
"error": "An internal error occurred while fetching withdrawals.",
"code": "INTERNAL_ERROR",
"responseMetadata": {
"timestamp": 1705313400
}
}
Notes:
- Withdrawals are returned in reverse chronological order (newest first)
- If you have no withdrawals, the
withdrawalsarray will be empty - Use this to get an overview of all your withdrawal activity
- Each withdrawal includes the same fields as
getWithdrawalStatus - Amount values are in the token's smallest unit (for USDC, micro-USDC)
Related operations: Use initiateWithdrawal to create a new withdrawal, and getWithdrawalStatus to check the status of a specific withdrawal.