Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2131,6 +2131,15 @@
"reference/hyperliquid-info-approved-builders",
"reference/hyperliquid-info-perp-concise-annotations",
"reference/hyperliquid-info-settled-outcome",
"reference/hyperliquid-info-gossip-priority-auction-status",
"reference/hyperliquid-info-sub-accounts2",
"reference/hyperliquid-info-is-vip",
"reference/hyperliquid-info-legal-check",
"reference/hyperliquid-info-pre-transfer-check",
"reference/hyperliquid-info-twap-history",
"reference/hyperliquid-info-user-borrow-lend-interest",
"reference/hyperliquid-info-user-twap-slice-fills-by-time",
"reference/hyperliquid-info-validator-summaries",
"reference/hyperliquid-exchange-place-order",
"reference/hyperliquid-exchange-cancel-order",
"reference/hyperliquid-exchange-cancel-order-by-cloid",
Expand All @@ -2146,6 +2155,18 @@
"reference/hyperliquid-exchange-twap-order",
"reference/hyperliquid-exchange-twap-cancel",
"reference/hyperliquid-exchange-user-outcome",
"reference/hyperliquid-exchange-borrow-lend",
"reference/hyperliquid-exchange-create-vault",
"reference/hyperliquid-exchange-vault-modify",
"reference/hyperliquid-exchange-vault-distribute",
"reference/hyperliquid-exchange-sub-account-modify",
"reference/hyperliquid-exchange-set-display-name",
"reference/hyperliquid-exchange-register-referrer",
"reference/hyperliquid-exchange-finalize-evm-contract",
"reference/hyperliquid-exchange-gossip-priority-bid",
"reference/hyperliquid-exchange-link-staking-user",
"reference/hyperliquid-exchange-staking-link-disable-trading-user",
"reference/hyperliquid-exchange-user-portfolio-margin",
"reference/hyperliquid-exchange-approve-agent",
"reference/hyperliquid-exchange-approve-builder-fee",
"reference/hyperliquid-exchange-set-referrer",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"openapi": "3.0.0",
"info": {
"title": "Hyperliquid Exchange API",
"version": "1.0.0",
"description": "API for trading operations on Hyperliquid exchange requiring authentication. ⚠️ WARNING: These endpoints require EIP-712 signatures for authentication. The example values provided will NOT work without proper cryptographic signing. You must implement EIP-712 signing to use these endpoints successfully."
},
"servers": [
{
"url": "https://api.hyperliquid.xyz"
}
],
"paths": {
"/exchange": {
"post": {
"tags": [
"hyperliquid exchange"
],
"summary": "Borrow / lend (supply, withdraw, repay, borrow)",
"operationId": "borrowLend",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"action": {
"type": "object",
"properties": {
"type": { "type": "string", "default": "borrowLend", "enum": ["borrowLend"], "description": "Action type" },
"operation": { "type": "string", "enum": ["supply", "withdraw", "repay", "borrow"], "description": "Borrow/lend operation to perform" },
"token": { "type": "integer", "description": "Token ID" },
"amount": { "type": "string", "nullable": true, "description": "Amount to supply/withdraw/repay/borrow (null = full)" }
},
"required": ["type", "operation", "token", "amount"]
},
"nonce": { "type": "integer", "description": "Current timestamp in milliseconds" },
"signature": {
"type": "object",
"description": "EIP-712 signature of the action with r, s, v components",
"properties": {
"r": { "type": "string", "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" },
"s": { "type": "string", "example": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321" },
"v": { "type": "integer", "example": 27 }
},
"required": ["r", "s", "v"]
},
"vaultAddress": { "type": "string", "nullable": true, "description": "Address when acting on behalf of a vault (optional)" },
"expiresAfter": { "type": "integer", "description": "Timestamp in milliseconds after which the request is rejected (optional)" }
},
"required": ["action", "nonce", "signature"]
},
"example": {
"action": { "type": "borrowLend", "operation": "supply", "token": 0, "amount": "1" },
"nonce": 1705234567890,
"signature": { "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321", "v": 27 }
}
}
}
},
"responses": {
"200": {
"description": "Borrow/lend result",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": { "type": "string", "description": "Request status" },
"response": { "type": "object", "properties": { "type": { "type": "string", "default": "default" } } }
},
"example": { "status": "ok", "response": { "type": "default" } }
}
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"openapi": "3.0.0",
"info": {
"title": "Hyperliquid Exchange API",
"version": "1.0.0",
"description": "API for trading operations on Hyperliquid exchange requiring authentication. ⚠️ WARNING: These endpoints require EIP-712 signatures for authentication. The example values provided will NOT work without proper cryptographic signing. You must implement EIP-712 signing to use these endpoints successfully."
},
"servers": [
{
"url": "https://api.hyperliquid.xyz"
}
],
"paths": {
"/exchange": {
"post": {
"tags": [
"hyperliquid exchange"
],
"summary": "Create vault",
"operationId": "createVault",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"action": {
"type": "object",
"properties": {
"type": { "type": "string", "default": "createVault", "enum": ["createVault"], "description": "Action type" },
"name": { "type": "string", "description": "Vault name (3-50 characters)" },
"description": { "type": "string", "description": "Vault description (10-250 characters)" },
"initialUsd": { "type": "integer", "description": "Initial balance as USD float * 1e6 (minimum 100 USD = 100000000)" },
"nonce": { "type": "integer", "description": "Timestamp in milliseconds, equal to the envelope nonce" }
},
"required": ["type", "name", "description", "initialUsd", "nonce"]
},
"nonce": { "type": "integer", "description": "Current timestamp in milliseconds" },
"signature": {
"type": "object",
"description": "EIP-712 signature of the action with r, s, v components",
"properties": {
"r": { "type": "string", "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" },
"s": { "type": "string", "example": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321" },
"v": { "type": "integer", "example": 27 }
},
"required": ["r", "s", "v"]
},
"expiresAfter": { "type": "integer", "description": "Timestamp in milliseconds after which the request is rejected (optional)" }
},
"required": ["action", "nonce", "signature"]
},
"example": {
"action": { "type": "createVault", "name": "My vault", "description": "A vault for copy trading", "initialUsd": 100000000, "nonce": 1705234567890 },
"nonce": 1705234567890,
"signature": { "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321", "v": 27 }
}
}
}
},
"responses": {
"200": {
"description": "Create vault result, including the new vault address",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": { "type": "string", "description": "Request status" },
"response": {
"type": "object",
"properties": {
"type": { "type": "string", "default": "createVault" },
"data": { "type": "string", "description": "Address of the newly created vault" }
}
}
},
"example": { "status": "ok", "response": { "type": "createVault", "data": "0x1719884eb866cb12b2287399b15f7db5e7d775ea" } }
}
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"openapi": "3.0.0",
"info": {
"title": "Hyperliquid Exchange API",
"version": "1.0.0",
"description": "API for trading operations on Hyperliquid exchange requiring authentication. ⚠️ WARNING: These endpoints require EIP-712 signatures for authentication. The example values provided will NOT work without proper cryptographic signing. You must implement EIP-712 signing to use these endpoints successfully."
},
"servers": [
{
"url": "https://api.hyperliquid.xyz"
}
],
"paths": {
"/exchange": {
"post": {
"tags": ["hyperliquid exchange"],
"summary": "Finalize EVM contract linkage",
"operationId": "finalizeEvmContract",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"action": {
"type": "object",
"properties": {
"type": { "type": "string", "default": "finalizeEvmContract", "enum": ["finalizeEvmContract"], "description": "Action type" },
"token": { "type": "integer", "description": "Token identifier to link" },
"input": {
"description": "Verification method matching how the EVM contract was deployed. Either an object { \"create\": { \"nonce\": <deploy nonce> } } for an EOA-deployed contract, or one of the string literals \"firstStorageSlot\" or \"customStorageSlot\".",
"oneOf": [
{
"type": "object",
"properties": {
"create": {
"type": "object",
"properties": { "nonce": { "type": "integer", "description": "Nonce used to deploy the EVM contract" } },
"required": ["nonce"]
}
},
"required": ["create"]
},
{ "type": "string", "enum": ["firstStorageSlot", "customStorageSlot"] }
]
}
},
"required": ["type", "token", "input"]
},
"nonce": { "type": "integer", "description": "Current timestamp in milliseconds" },
"signature": {
"type": "object",
"description": "EIP-712 signature of the action with r, s, v components",
"properties": {
"r": { "type": "string", "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" },
"s": { "type": "string", "example": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321" },
"v": { "type": "integer", "example": 27 }
},
"required": ["r", "s", "v"]
},
"expiresAfter": { "type": "integer", "description": "Timestamp in milliseconds after which the request is rejected (optional)" }
},
"required": ["action", "nonce", "signature"]
},
"example": {
"action": { "type": "finalizeEvmContract", "token": 0, "input": "firstStorageSlot" },
"nonce": 1705234567890,
"signature": { "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321", "v": 27 }
}
}
}
},
"responses": {
"200": {
"description": "Finalize EVM contract result",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": { "type": "string", "description": "Request status" },
"response": { "type": "object", "properties": { "type": { "type": "string", "default": "default" } } }
},
"example": { "status": "ok", "response": { "type": "default" } }
}
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"openapi": "3.0.0",
"info": {
"title": "Hyperliquid Exchange API",
"version": "1.0.0",
"description": "API for trading operations on Hyperliquid exchange requiring authentication. ⚠️ WARNING: These endpoints require EIP-712 signatures for authentication. The example values provided will NOT work without proper cryptographic signing. You must implement EIP-712 signing to use these endpoints successfully."
},
"servers": [
{
"url": "https://api.hyperliquid.xyz"
}
],
"paths": {
"/exchange": {
"post": {
"tags": ["hyperliquid exchange"],
"summary": "Bid in the gossip priority auction",
"operationId": "gossipPriorityBid",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"action": {
"type": "object",
"properties": {
"type": { "type": "string", "default": "gossipPriorityBid", "enum": ["gossipPriorityBid"], "description": "Action type" },
"slotId": { "type": "integer", "enum": [0, 1], "description": "Auction slot identifier (0 or 1). Lower-indexed slots are strictly prioritized." },
"ip": { "type": "string", "description": "IP address (IPv4 or IPv6) to prioritize. Any address may bid on behalf of any IP." },
"maxGas": { "type": "integer", "description": "Max gas in wei (1 HYPE = 10^8 wei) charged from spot balance. Minimum auction price is 0.1 HYPE." }
},
"required": ["type", "slotId", "ip", "maxGas"]
},
"nonce": { "type": "integer", "description": "Current timestamp in milliseconds" },
"signature": {
"type": "object",
"description": "EIP-712 signature of the action with r, s, v components",
"properties": {
"r": { "type": "string", "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" },
"s": { "type": "string", "example": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321" },
"v": { "type": "integer", "example": 27 }
},
"required": ["r", "s", "v"]
},
"expiresAfter": { "type": "integer", "description": "Timestamp in milliseconds after which the request is rejected (optional)" }
},
"required": ["action", "nonce", "signature"]
},
"example": {
"action": { "type": "gossipPriorityBid", "slotId": 0, "ip": "1.2.3.4", "maxGas": 10000000 },
"nonce": 1705234567890,
"signature": { "r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321", "v": 27 }
}
}
}
},
"responses": {
"200": {
"description": "Gossip priority bid result",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": { "type": "string", "description": "Request status" },
"response": { "type": "object", "properties": { "type": { "type": "string", "default": "default" } } }
},
"example": { "status": "ok", "response": { "type": "default" } }
}
}
}
}
}
}
}
}
}
Loading