Skip to content
Stove Website

Get Stock Token Address ​

Endpoint Information ​

Endpoint: GET /api/v1/instruments/token-address

Description: Get the token contract address for a stock based on ticker and exchange ID

Authentication: API Key + Signature. See Authorization

Request Parameters ​

ParameterTypeRequiredDescription
tickerstringYesStock ticker symbol (e.g., AAPLs)
exchangenumberYesExchange ID, see Exchange enum
chain_idnumberNoBlockchain network ID, uses system default chain ID if not provided

Response Parameters ​

FieldTypeDescription
tickerstringStock ticker symbol
stock_codestringOptional Stock code
namestringStock name
exchange_idnumberExchange ID
chain_idnumberBlockchain network ID
token_addressstringToken contract address
token_typestringOptional Token type (stock or share)
underlying_tokenstringOptional Underlying StockToken address (for ShareToken)
decimalsintToken decimals (0 for StockToken, 18 for ShareToken)
is_activebooleanWhether the token is active
lot_sizedecimalBoard lots (default 1 for US stocks)
spread_table_codestringPrice Ticker (Default 1 for US stocks)

Request Example ​

Query Using Default Chain ID ​

bash
curl -X GET "{API_BASE_URL}/api/v1/instruments/token-address?ticker=AAPLs&exchange=0" \
     -H "X-API-Key: YOUR_API_KEY" \
     -H "X-Maker-Addr: YOUR_MAKER_ADDRESS" \
     -H "X-API-Timestamp: 1715100000000" \
     -H "X-API-Signature: GENERATED_SIGNATURE" \
     -H "Content-Type: application/json"

Query Specifying Chain ID (BSC) ​

bash
curl -X GET "{API_BASE_URL}/api/v1/instruments/token-address?ticker=AAPLs&exchange=0&chain_id=56" \
     -H "X-API-Key: YOUR_API_KEY" \
     -H "X-Maker-Addr: YOUR_MAKER_ADDRESS" \
     -H "X-API-Timestamp: 1715100000000" \
     -H "X-API-Signature: GENERATED_SIGNATURE" \
     -H "Content-Type: application/json"

Response Examples ​

Success Response (StockToken) ​

json
{
  "code": 0,
  "data": {
    "ticker": "AAPL",
    "stock_code": "AAPL",
    "name": "Apple Inc.",
    "exchange_id": 0,
    "chain_id": 56,
    "token_address": "0x1234567890abcdef1234567890abcdef12345678",
    "token_type": "stock",
    "underlying_token": null,
    "decimals": 0,
    "is_active": true,
    "lot_size": "1",
    "spread_table_code": "1"
  }
}

Success Response (ShareToken) ​

json
{
  "code": 0,
  "data": {
    "ticker": "AAPLs",
    "stock_code": "AAPL",
    "name": "Apple Inc. Share Token",
    "exchange_id": 0,
    "chain_id": 56,
    "token_address": "0xabcdef1234567890abcdef1234567890abcdef12",
    "token_type": "share",
    "underlying_token": "0x1234567890abcdef1234567890abcdef12345678",
    "decimals": 18,
    "is_active": true,
    "lot_size": "1",
    "spread_table_code": "1"
  }
}

Error Responses ​

Missing ticker parameter:

json
{
  "error": "Not found: not found or not available: ticker=, exchange=0, chain_id=56"
}

Missing exchange parameter:

json
{
  "error": "Failed to deserialize query string: cannot parse integer from empty string"
}

Ticker does not exit or the parameters do not match.:

json
{
  "error": "Not found: not found or not available: ticker=INVALID, exchange=0, chain_id=56"
}

Use Cases ​

  • Query token address before creating an order
  • Verify if a stock is available on the platform
  • Get basic information about a stock
  • Query token address on a specific chain in cross-chain scenarios

Implementation Notes ​

  • Supports querying token addresses on specific blockchain networks via the chain_id parameter
  • If chain_id is not provided, the system uses the default chain ID from the configuration file
  • Query results are cached for 4 hours (14400 seconds) to improve performance
  • Cache key format: token_addr:{ticker}:{exchange_id}:{chain_id}