
# Marché au comptant {#spot}

La section documente les points de terminaison d'informations spécifiques au spot.

## Récupérer les métadonnées spot {#retrieve-spot-metadata}

<mark style="color:green;">`POST`</mark> `https://api.hyperliquid.xyz/info`

**En-têtes**

| Nom | Valeur |
| ---------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | "application/json" |

**Corps**

| Nom | Type | Description |
| -------------------------------------- | ------ | ----------- |
| type<mark style="color:red;">\*</mark> | String | "spotMeta" |

**Réponse**


**200: OK Réponse réussie**


```json
{
    "tokens": [
        {
            "name": "USDC",
            "szDecimals": 8,
            "weiDecimals" 8,
            "index": 0,
            "tokenId": "0x6d1e7cde53ba9467b783cb7c530ce054",
            "isCanonical": true,
            "evmContract":null,
            "fullName":null
        },
        {
            "name": "PURR",
            "szDecimals": 0,
            "weiDecimals": 5,
            "index": 1,
            "tokenId": "0xc1fb593aeffbeb02f85e0308e9956a90",
            "isCanonical": true,
            "evmContract":null,
            "fullName":null
        },
        {
            "name": "HFUN",
            "szDecimals": 2,
            "weiDecimals": 8,
            "index": 2,
            "tokenId": "0xbaf265ef389da684513d98d68edf4eae",
            "isCanonical": false,
            "evmContract":null,
            "fullName":null
        },
    ],
    "universe": [
        {
            "name": "PURR/USDC",
            "tokens": [1, 0],
            "index": 0,
            "isCanonical": true
        },
        {
            "tokens": [2, 0],
            "name": "@1",
            "index": 1,
            "isCanonical": false
        },
    ]
}
```


## Récupérer les contextes d'actifs ponctuels {#retrieve-spot-asset-contexts}

<mark style="color:green;">`POST`</mark> `https://api.hyperliquid.xyz/info`

#### En-têtes {#headers}

| Nom | Type | Description |
| ---------------------------------------------- | ------ | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | String | "application/json" |

#### Corps de la requête {#request-body}

| Nom | Type | Description |
| -------------------------------------- | ------ | ---------------------- |
| type<mark style="color:red;">\*</mark> | String | "spotMetaAndAssetCtxs" |


**200: OK Réponse réussie**


```json
[
{
    "tokens": [
        {
            "name": "USDC",
            "szDecimals": 8,
            "weiDecimals" 8,
            "index": 0,
            "tokenId": "0x6d1e7cde53ba9467b783cb7c530ce054",
            "isCanonical": true,
            "evmContract":null,
            "fullName":null
        },
        {
            "name": "PURR",
            "szDecimals": 0,
            "weiDecimals": 5,
            "index": 1,
            "tokenId": "0xc1fb593aeffbeb02f85e0308e9956a90",
            "isCanonical": true,
            "evmContract":null,
            "fullName":null
        }
    ],
    "universe": [
        {
            "name": "PURR/USDC",
            "tokens": [1, 0],
            "index": 0,
            "isCanonical": true
        }
    ]
},
[
    {
        "dayNtlVlm":"8906.0",
        "markPx":"0.14",
        "midPx":"0.209265",
        "prevDayPx":"0.20432"
    }
]
]
```


## Récupérer les soldes de jetons d'un utilisateur {#retrieve-a-users-token-balances}

<mark style="color:green;">`POST`</mark> `https://api.hyperliquid.xyz/info`

Voir les soldes de jetons d'un utilisateur.

Sous la marge de compte ou de portefeuille unifié, c'est la source de vérité pour le solde du compte de trading à travers le spot et les perps.

#### En-têtes {#headers_1}

| Nom | Type | Description |
| ---------------------------------------------- | ---- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> |      | "application/json" |

#### Corps de la requête {#request-body_1}

| Nom | Type | Description |
| -------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------- |
| type<mark style="color:red;">\*</mark> | String | "spotClearinghouseState" |
| user<mark style="color:red;">\*</mark> | String | Adresse onchain au format hexadécimal 42-caractère; par exemple 0x0000000000000000000000000000000000000000. |


**200: OK Réponse réussie**


```json
{
    "balances": [
        {
            "coin": "USDC",
            "token": 0,
            "hold": "0.0",
            "total": "14.625485",
            "entryNtl": "0.0"
        },
        {
            "coin": "PURR",
            "token": 1,
            "hold": "0.0",
            "total": "2000.0",
            "entryNtl": "1234.56"
        },
        {
            "coin": "+1230",
            "hold": "0.0",
            "total": "25.0",
            "entryNtl": "12.5"
        }
    ]
}
```


## Récupérer des informations sur la vente aux enchères Spot Deploy {#retrieve-information-about-the-spot-deploy-auction}

<mark style="color:green;">`POST`</mark> `https://api.hyperliquid.xyz/info`

**En-têtes**

| Nom | Valeur |
| ---------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | "application/json" |

**Corps**

| Nom | Type | Description |
| -------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------- |
| type<mark style="color:red;">\*</mark> | String | "spotDeployState" |
| user<mark style="color:red;">\*</mark> | String | Adresse onchain au format hexadécimal 42-caractère; par exemple 0x0000000000000000000000000000000000000000. |

**Réponse**


**200: OK Réponse réussie**


```json
{
  "states": [
    {
      "token": 150,
      "spec" : {
        "name": "HYPE",
        "szDecimals": 2,
        "weiDecimals": 8,
      },
      "fullName": "Hyperliquid",
      "spots": [107],
      "maxSupply": 1000000000,
      "hyperliquidityGenesisBalance": "120000",
      "totalGenesisBalanceWei": "100000000000000000",
      "userGenesisBalances": [
        ("0xdddddddddddddddddddddddddddddddddddddddd", "428,062,211")...
      ],
      "existingTokenGenesisBalances": [
        (1, "0")...
      ]
    }
  ],
  "gasAuction": {
    "startTimeSeconds": 1733929200,
    "durationSeconds": 111600,
    "startGas": "181305.90046",
    "currentGas": null,
    "endGas": "181291.247358"
  }
}
```


## Récupérer des informations sur la vente aux enchères Spot Pair Deploy {#retrieve-information-about-the-spot-pair-deploy-auction}

<mark style="color:green;">`POST`</mark> `https://api.hyperliquid.xyz/info`

Remarque : Cela renvoie le statut de la vente aux enchères néerlandaise pour les déploiements de paires au comptant entre les jetons de base et de cotation existants. La participation à cette vente aux enchères est sans permission grâce à la même action que la phase `registerSpot` du déploiement du jeton de base.

#### En-têtes {#headers_2}

| Nom | Valeur |
| ---------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | "application/json" |

#### Corps {#body}

| Nom | Type | Description |
| -------------------------------------- | ------ | ----------------------------- |
| type<mark style="color:red;">\*</mark> | String | "spotPairDeployAuctionStatus" |


**200: OK Réponse réussie**


```json
{
  "startTimeSeconds":1755468000,
  "durationSeconds":111600,
  "startGas":"500.0",
  "currentGas":"500.0",
  "endGas":null
}
```


## Récupérer des informations sur un jeton {#retrieve-information-about-a-token}

<mark style="color:green;">`POST`</mark> `https://api.hyperliquid.xyz/info`

**En-têtes**

| Nom | Valeur |
| ---------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | "application/json" |

**Corps**

| Nom | Type | Description |
| ----------------------------------------- | ------ | --------------------------------------------------------------------------------------- |
| type<mark style="color:red;">\*</mark>    | String | "tokenDetails" |
| tokenId<mark style="color:red;">\*</mark> | String | Identifiant onchain au format hexadécimal 34-caractère; par exemple 0x00000000000000000000000000000000. |

**Réponse**


**200: OK Réponse réussie**


```json
{
  "name": "TEST",
  "maxSupply": "1852229076.12716007",
  "totalSupply": "851681534.05516005",
  "circulatingSupply": "851681534.05516005",
  "szDecimals": 0,
  "weiDecimals": 5,
  "midPx": "3.2049",
  "markPx": "3.2025",
  "prevDayPx": "3.2025",
  "genesis": {
    "userBalances": [
      [
        "0x0000000000000000000000000000000000000001",
        "1000000000.0"
      ],
      [
        "0xffffffffffffffffffffffffffffffffffffffff",
        "1000000000.0"
      ]
    ],
    "existingTokenBalances": []
  },
  "deployer": "0x0000000000000000000000000000000000000001",
  "deployGas": "100.0",
  "deployTime": "2024-06-05T10:50:59.434",
  "seededUsdc": "0.0",
  "nonCirculatingUserBalances": [],
  "futureEmissions": "0.0"
}
```


## Récupérer les métadonnées de résultat {#retrieve-outcome-metadata}

<mark style="color:green;">`POST`</mark> `https://api.hyperliquid.xyz/info`

Reportez-vous à la section Identifiants d'actifs pour connaître le format utilisé par API pour faire référence aux résultats. Les résultats et les questions déployés à partir d'un modèle ont le `name` `template:<id>`, où `<id>` est le `id` du modèle dans la réponse `outcomeTemplates`. Voir les documents de déploiement HIP-4 pour leur format de description.

Les résultats et questions récurrents sont nommés `Recurring`, et leur `description` est des paires `|` séparées par `key:value` commençant par `class`. `expiry` est un temps UTC au format `YYYYMMDD-HHMM`, et `underlying` est un nom de pièce perp. Les descriptions peuvent contenir d'autres clés, qui peuvent être ignorées.

* `class:priceBinary` est un résultat autonome, par exemple `class:priceBinary|underlying:BTC|expiry:20260526-0600|targetPrice:77363|period:1d`. Il se résout à Oui si le prix de la marque `underlying` à `expiry` est supérieur à `targetPrice`.
* `class:priceBucket` est une question, par exemple `class:priceBucket|underlying:BTC|expiry:20260615-0600|priceThresholds:63250,65831|period:1d`, où `priceThresholds` est `<lower>,<upper>`. Basé sur le prix de référence `underlying` à `expiry`:
  * Le résultat avec la description `index:0` est Oui si le prix est inférieur à `lower`.
  * Le résultat avec la description `index:1` est résolu à Oui si le prix est au moins `lower` et en dessous de `upper`.
  * Le résultat avec la description `index:2` se résout en Oui si le prix est au moins `upper`.

**En-têtes**

| Nom | Valeur |
| ---------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | "application/json" |

**Corps**

| Nom | Type | Description |
| -------------------------------------- | ------ | ------------- |
| type<mark style="color:red;">\*</mark> | String | "outcomeMeta" |

**Réponse**


**200: OK Réponse réussie**


```json
{
  "outcomes": [
    {
      "outcome": 123,
      "name": "Recurring",
      "description": "class:priceBinary|underlying:HYPE|expiry:20260310-1100|targetPrice:34.5|period:3m",
      "sideSpecs": [
        {
          "name": "Yes"
        },
        {
          "name": "No"
        }
      ]
    }
  ]
}
```


## Récupérer les modèles de résultat {#retrieve-outcome-templates}

<mark style="color:green;">`POST`</mark> `https://api.hyperliquid.xyz/info`

**En-têtes**

| Nom | Valeur |
| ---------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | "application/json" |

**Corps**

| Nom | Type | Description |
| -------------------------------------- | ------ | ------------------ |
| type<mark style="color:red;">\*</mark> | String | "outcomeTemplates" |

Retourne tous les modèles de résultat. `role` est l'un des `{"standaloneOutcome": {"sideNames": [...]}}`, `"question"` ou `{"questionOutcome": {"parent": <question template id>}}`. `name` et `description` contiennent des espaces réservés `{keyword}`, et `keywords` répertorie chaque mot-clé avec son type comme paires `[keyword, type]`. Voir les documents de déploiement HIP-4 pour le format de valeur de chaque type.

**Réponse**


**200: OK Réponse réussie**


```json
[
  {
    "id": "binaryPrice",
    "role": { "standaloneOutcome": { "sideNames": ["Yes", "No"] } },
    "name": "{perp} above {threshold} at {time}?",
    "description": "The market resolves to Yes if the {perp} price is above {threshold} at {time}, and otherwise resolves to No. Settlement is according to the {seconds}-second TWAP of {priceDescription} price ending at {time}. If {perp} is delisted before this market settles, settlement is instead according to the {perp} settlement price at delisting. metadata=category:price|subCategory:N/A|semanticRestriction:This market must refer to the price of a Hyperliquid perp.",
    "keywords": [["perp", "hlPerp"], ["priceDescription", "string"], ["seconds", "uInt"], ["threshold", "uDecimal"], ["time", "dateTime"]]
  },
  {
    "id": "policyRateDecision",
    "role": "question",
    "name": "{institution} {decisionLabel} rate decision",
    "description": "This market has three possible results: No change, Decrease, or Increase. Exactly one corresponding named outcome resolves to Yes; the other two and the protocol-created fallback resolve to No. It covers the {decisionLabel} {institution} decision concerning {policyMeasure}, scheduled for {scheduledDecision} UTC (the \"Decision\"). The Decision Value is the numeric value of {policyMeasure} announced by {officialSource}. The Prior Value is the value of that same measure in effect immediately before the Decision. No change resolves to Yes if the Decision Value equals the Prior Value. Decrease resolves to Yes if the Decision Value is lower. Increase resolves to Yes if the Decision Value is higher. If the Decision is rescheduled, the rescheduled decision applies if {officialSource} publishes it by {decisionDeadline} UTC. If the Decision is canceled or postponed without a replacement decision, or no official Decision Value is published by {decisionDeadline} UTC, No change resolves to Yes. Policy changes outside the scheduled Decision are ignored except when establishing the Prior Value. If {institution} replaces {policyMeasure}, the closest official successor measure identified by {officialSource} is used. Resolution uses the initially published decision; later revisions do not change the resolution. {officialSource} is the primary resolution source; independent reputable reporting may be used if it has not published the relevant decision. No change resolves to Yes under the deadline rule above only if neither {officialSource} nor independent reputable reporting establishes a Decision Value by {decisionDeadline} UTC. metadata=category:economics|subCategory:N/A|semanticRestriction:This market must refer to a scheduled policy rate decision by an official institution.",
    "keywords": [["decisionDeadline", "dateTime"], ["decisionLabel", "string"], ["institution", "string"], ["officialSource", "string"], ["policyMeasure", "string"], ["scheduledDecision", "dateTime"]]
  },
  {
    "id": "policyRateDecrease",
    "role": { "questionOutcome": { "parent": "policyRateDecision" } },
    "name": "Decrease",
    "description": "This outcome resolves to Yes if the Decision Value is lower than the Prior Value under the parent question's rules.",
    "keywords": []
  }
]
```


## Récupérer des informations sur un résultat réglé {#retrieve-information-about-a-settled-outcome}

<mark style="color:green;">`POST`</mark> `https://api.hyperliquid.xyz/info`

**En-têtes**

| Nom | Valeur |
| ---------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | "application/json" |

**Corps**

| Nom | Type | Description |
| ----------------------------------------- | ------ | ---------------- |
| type<mark style="color:red;">\*</mark>    | String | "settledOutcome" |
| outcome<mark style="color:red;">\*</mark> | int    | Résultat |

**Réponse**


**200: OK Réponse réussie**


```json
{
  "spec": {
    "outcome": 95,
    "name": "Recurring",
    "description": "class:priceBinary|underlying:BTC|expiry:20260526-0600|targetPrice:77363|period:1d",
    "sideSpecs": [
      {
        "name": "Yes"
      },
      {
        "name": "No"
      }
    ],
    "quoteToken": "USDC"
  },
  "settleFraction": "0.0",
  "details": "price:76876.9"
}
```


## Récupérer les limites du déployeur de résultats {#retrieve-outcome-deployer-limits}

<mark style="color:green;">`POST`</mark> `https://api.hyperliquid.xyz/info`

**En-têtes**

| Nom | Valeur |
| ---------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | "application/json" |

**Corps**

| Nom | Type | Description |
| --------------------------------------- | ------ | ----------------------- |
| type<mark style="color:red;">\*</mark>  | String | "outcomeDeployerLimits" |
| venue<mark style="color:red;">\*</mark> | String | Nom du lieu |

**Réponse**


**200: OK Réponse réussie**


```json
{
  "nDailyOutcomesRemaining": 50,
  "nActiveOutcomesRemaining": 14
}
```
