> For the complete documentation index, see [llms.txt](https://docs.bbx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bbx.com/bbx-dex-public-api/coingecko-integration/contracts-and-contract-specifications.md).

# Contracts & Contract Specifications

Returns the active cryptocurrency perpetual futures markets supported by **BBX DEX** for CoinGecko derivatives exchange integration.

This endpoint combines CoinGecko's **Contracts** and **Contract Specs** requirements into a single response.

Delisted, disabled, spot, and non-crypto markets are excluded.

***

### Endpoint

```http
GET /fapi/market/v1/public/coingecko/contracts
```

### Full URL

```
https://dex.bbx.com/fapi/market/v1/public/coingecko/contracts
```

***

### Authentication

No authentication is required.

The endpoint is publicly accessible and does not require:

* An API key
* A request signature
* Login credentials
* An authentication token
* A custom request header

***

### Query Parameters

This endpoint does not require any query parameters.

***

### Market Scope

The endpoint returns active cryptocurrency perpetual futures markets supported by BBX for CoinGecko integration.

The following instruments are excluded:

* Delisted or disabled contracts
* Spot markets
* Tokenized equities and stock futures
* ETFs and indices
* Commodities
* Other non-crypto instruments

***

### Example Request

```bash
curl -s \
  'https://dex.bbx.com/fapi/market/v1/public/coingecko/contracts'
```

***

### Example Response

```json
[
  {
    "ticker_id": "BTC-USDT",
    "base_currency": "BTC",
    "target_currency": "USDT",
    "last_price": "67250.5",
    "base_volume": "1523.447",
    "target_volume": "102450321.88",
    "bid": "67249.8",
    "ask": "67251.2",
    "high": "68100.0",
    "low": "66300.0",
    "product_type": "Perpetual",
    "open_interest": "8452.331",
    "open_interest_usd": "568432100.55",
    "index_price": "67248.9",
    "index_name": "BTC-USDT",
    "index_currency": "USDT",
    "funding_rate": "0.0001",
    "next_funding_rate": "0.0001",
    "next_funding_rate_timestamp": 1721548800,
    "contract_type": "Vanilla",
    "contract_price": "0.0001",
    "contract_price_currency": "USDT"
  }
]
```

> The values shown above are illustrative. Live responses contain current BBX market data.

***

### Response Fields

#### Market Data

| Field             | Type   | Requirement | Description                                                         |
| ----------------- | ------ | ----------- | ------------------------------------------------------------------- |
| `ticker_id`       | string | Mandatory   | Contract identifier in `BASE-TARGET` format, for example `BTC-USDT` |
| `base_currency`   | string | Mandatory   | Base asset symbol                                                   |
| `target_currency` | string | Mandatory   | Target or quote asset symbol                                        |
| `last_price`      | string | Mandatory   | Latest traded price                                                 |
| `base_volume`     | string | Mandatory   | Rolling 24-hour trading volume in base-asset units                  |
| `target_volume`   | string | Mandatory   | Rolling 24-hour trading volume in target-currency units             |
| `bid`             | string | Recommended | Current highest bid price; omitted if the bid side is empty         |
| `ask`             | string | Recommended | Current lowest ask price; omitted if the ask side is empty          |
| `high`            | string | Recommended | Rolling 24-hour highest traded price                                |
| `low`             | string | Recommended | Rolling 24-hour lowest traded price                                 |

#### Product Information

| Field             | Type    | Requirement | Description                                                                         |
| ----------------- | ------- | ----------- | ----------------------------------------------------------------------------------- |
| `product_type`    | string  | Mandatory   | Product type: `Perpetual` or `Futures`                                              |
| `start_timestamp` | integer | Optional    | Product start time as a Unix timestamp in seconds; omitted when unavailable         |
| `end_timestamp`   | integer | Optional    | Product expiry time as a Unix timestamp in seconds; omitted for perpetual contracts |

#### Open Interest and Index Data

| Field               | Type   | Requirement | Description                                                          |
| ------------------- | ------ | ----------- | -------------------------------------------------------------------- |
| `open_interest`     | string | Mandatory   | Double-sided open interest in base-asset units                       |
| `open_interest_usd` | string | Mandatory   | Double-sided open interest in USD                                    |
| `index_price`       | string | Mandatory   | Current underlying index price                                       |
| `index_name`        | string | Recommended | Name or identifier of the underlying index; omitted when unavailable |
| `index_currency`    | string | Mandatory   | Quote currency of the underlying index                               |

#### Funding Data

| Field                         | Type    | Requirement              | Description                                      |
| ----------------------------- | ------- | ------------------------ | ------------------------------------------------ |
| `funding_rate`                | string  | Mandatory for perpetuals | Current funding rate                             |
| `next_funding_rate`           | string  | Mandatory for perpetuals | Funding-rate value for the next funding interval |
| `next_funding_rate_timestamp` | integer | Mandatory for perpetuals | Next funding time as a Unix timestamp in seconds |

#### Contract Specifications

| Field                     | Type   | Requirement | Description                                                             |
| ------------------------- | ------ | ----------- | ----------------------------------------------------------------------- |
| `contract_type`           | string | Mandatory   | `Vanilla` for linear contracts or `Inverse` for coin-margined contracts |
| `contract_price`          | string | Mandatory   | Contract size or price represented by one contract                      |
| `contract_price_currency` | string | Mandatory   | Currency in which the contract is priced                                |

***

### Pair Naming

Contract identifiers use the following format:

```
BASE-TARGET
```

Examples:

```
BTC-USDT
ETH-USDT
SOL-USDT
```

***

### Numeric Values

Prices, volumes, open-interest values, and funding rates are returned as strings to avoid floating-point precision loss.

Example:

```json
{
  "last_price": "67250.5",
  "open_interest": "8452.331",
  "funding_rate": "0.0001"
}
```

Timestamps are returned as JSON integers.

***

### Timestamp Units

The following fields use Unix timestamps in seconds:

```
start_timestamp
end_timestamp
next_funding_rate_timestamp
```

Perpetual contracts may omit `start_timestamp` and `end_timestamp`.

***

### Open Interest Methodology

The endpoint reports open interest using CoinGecko's double-sided methodology.

Double-sided open interest represents the combined long and short open positions.

The API provides:

* `open_interest` in base-asset units
* `open_interest_usd` in USD

***

### Funding Rate Format

Funding rates are returned as decimal values and are not annualized.

Example:

```
0.0001 = 0.01%
```

The `next_funding_rate_timestamp` field identifies the beginning of the next funding interval.

***

### Data Availability

Recommended fields such as `bid`, `ask`, `high`, `low`, and `index_name` may be omitted when the corresponding market data is unavailable.

Mandatory fields are included for each active market returned by the endpoint.

Successful responses are returned as plain JSON without a wrapper envelope.
