# Token Query

### Token List Query

**Endpoint**: `GET /api/token/list`

**Request Parameters**:

```
page: 1                    // Page number
pageSize: 20              // Items per page
sort: market_cap          // Sort field
sort_direction: desc      // Sort direction
keyword: ""               // Search keyword
graduated: false          // Whether graduated
insurance_amt_gt: 0       // Conviction amount filter
network: mainnet          // Network
platform: meteora         // Platform
```

**Response Example**:

```json
{
  "code": 200,
  "data": {
    "items": [
      {
        "address": "token_address",
        "name": "token_name",
        "symbol": "token_symbol",
        "logo": "image_url",
        "description": "description",
        "market_cap": 1000000,
        "price_in_sol": 0.001,
        "price_in_usd": 0.17,
        "holders": 100,
        "status": "active",
        "created_at": "2024-01-01T00:00:00Z",
        "signer": "creator_address",
        "insurance_amt": 1000000000,
        "insurance_status": "reserved",
        "h24_chg": 10.5,
        "h24_vol": 50000
      }
    ],
    "total": 500,
    "page": 1
  }
}
```

### Token Detail Query

**Endpoint**: `GET /api/token/{address}`

**Response Example**:

```json
{
  "code": 200,
  "data": {
    "address": "token_address",
    "name": "token_name",
    "symbol": "token_symbol",
    "logo": "image_url",
    "description": "description",
    "market_cap": 1000000,
    "price_in_sol": 0.001,
    "price_in_usd": 0.17,
    "holders": 100,
    "status": "active",
    "progress": 75.5,
    "twitter": "twitter_link",
    "telegram": "telegram_link",
    "discord": "discord_link",
    "website": "website_link",
    "graduation_time": "graduation_time",
    "insurance_amt": 1000000000,
    "insurance_activation_price": 500000000,
    "insurance_status": "reserved",
    "has_deployed_insurance": true,
    "can_redeem_insurance": false
  }
}
```

### User Holdings Query

**Endpoint**: `GET /api/token/user/{address}/positions`

**Request Parameters**:

```
page: 1
pageSize: 10
sort: balance              // active, balance, pnl
sort_direction: desc
```

**Response Example**:

```json
{
  "code": 200,
  "data": [
    {
      "address": "token_address",
      "name": "token_name",
      "symbol": "token_symbol",
      "logo": "image_url",
      "balance": 1000000,
      "price_in_sol": 0.001,
      "price_in_usd": 0.17,
      "market_cap": 1000000,
      "h24_chg": 10.5,
      "insurance_status": "reserved",
      "can_redeem_insurance": false
    }
  ]
}
```

### User Created Tokens

**Endpoint**: `GET /api/token/user/{address}/created`

**Request Parameters**:

```
page: 1
pageSize: 10
sort: created_at
sortDirection: desc
```

### Pinned Token

**Endpoint**: `GET /api/token/pin`

**Response Example**:

```json
{
  "code": 200,
  "data": {
    // Pinned token details
  }
}
```

### Token Holders

**Endpoint**: `GET /api/token/{address}/holders`

**Response Example**:

```json
{
  "code": 200,
  "data": {
    "holders": [
      {
        "address": "holder_address",
        "amount": "1000000",
        "percentage": "5.5",
        "value_in_usd": "850"
      }
    ]
  }
}
```

### Filter Parameters

#### Sort Fields

* **market\_cap**: Market cap
* **created\_at**: Creation time
* **holders**: Number of holders
* **h24\_vol**: 24h trading volume
* **h24\_chg**: 24h price change

#### Status Filters

* **active**: Active trading
* **graduated**: Graduated
* **conviction**: Has Conviction Pool

### Key Points

* Supports pagination queries to avoid excessive data
* Provides multi-dimensional sorting and filtering
* Real-time price and market cap data
* User holdings and creation history
* Conviction pool status queries
