Hyperliquid API
AiCoin 开放 API 提供了 Hyperliquid 交易所的实时数据接口,支持获取 Ticker 行情、用户成交记录、成交订单和订单数据等。
获取所有 Ticker 数据
获取 Hyperliquid 所有币种的最新交易价格数据。
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
Ticker 数据数组
请求
curl -G https://open.aicoin.com/v2/hl/tickers \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"coin": "BTC",
"price": "42000.50"
},
{
"coin": "ETH",
"price": "2500.30"
}
]
}
获取指定币种 Ticker 数据
获取 Hyperliquid 指定币种的最新交易价格数据。
路径参数
- Name
coin- Type
- string
- Description
币种名称,如
ETH、BTC
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- object
- Description
指定币种的 Ticker 数据
请求
curl -G https://open.aicoin.com/v2/hl/tickers/coin/ETH \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": {
"coin": "ETH",
"price": "2500.30"
}
}
获取用户成交数据
获取指定地址的用户最新成交记录,按时间排序。
路径参数
- Name
address- Type
- string
- Description
用户钱包地址,如
0x0089xxx
查询参数
- Name
coin- Type
- string
- Description
可选,筛选指定币种的成交记录
- Name
limit- Type
- integer
- Description
可选,返回记录数量限制
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
成交记录数组
请求
curl -G "https://open.aicoin.com/v2/hl/fills/0x0089xxx?limit=20&coin=ETH" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"coin": "ETH",
"side": "buy",
"price": "2500.30",
"size": "1.5",
"time": 1704355200000,
"oid": "23103400500"
}
]
}
根据订单ID获取成交数据
获取指定订单 ID (oid) 的成交记录,按时间排序。
路径参数
- Name
oid- Type
- string
- Description
订单 ID,如
23103400500
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
成交记录数组
请求
curl -G https://open.aicoin.com/v2/hl/fills/oid/23103400500 \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"coin": "ETH",
"side": "buy",
"price": "2500.30",
"size": "1.5",
"time": 1704355200000,
"oid": "23103400500"
}
]
}
获取成交订单数据
获取指定地址的最新成交订单,按时间倒序排列。
路径参数
- Name
address- Type
- string
- Description
用户钱包地址,如
0x0089xxx
查询参数
- Name
coin- Type
- string
- Description
可选,筛选指定币种的成交订单
- Name
limit- Type
- integer
- Description
可选,返回记录数量限制,默认 1000
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
成交订单数组
请求
curl -G "https://open.aicoin.com/v2/hl/filled-orders/0x0089xxx/latest?coin=ETH&limit=1000" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"oid": "23671238460",
"coin": "ETH",
"side": "buy",
"price": "2500.30",
"size": "1.5",
"filledSize": "1.5",
"status": "filled",
"time": 1704355200000
}
]
}
根据订单ID获取成交订单
根据订单 ID (oid) 获取指定的成交订单详情。如不存在或未成交返回 null。
路径参数
- Name
oid- Type
- string
- Description
订单 ID,如
23671238460
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- object
- Description
成交订单详情,如不存在返回 null
请求
curl -G https://open.aicoin.com/v2/hl/filled-orders/oid/23671238460 \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": {
"oid": "23671238460",
"coin": "ETH",
"side": "buy",
"price": "2500.30",
"size": "1.5",
"filledSize": "1.5",
"status": "filled",
"time": 1704355200000
}
}
获取最新订单数据
获取指定地址的最新订单(含已取消),按时间倒序排列。
路径参数
- Name
address- Type
- string
- Description
用户钱包地址,如
0x0089xxx
查询参数
- Name
coin- Type
- string
- Description
可选,筛选指定币种的订单
- Name
limit- Type
- integer
- Description
可选,返回记录数量限制,默认 2000
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
订单数组
请求
curl -G "https://open.aicoin.com/v2/hl/orders/0x0089xxx/latest?coin=ETH&limit=2000" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"oid": "23671238461",
"coin": "ETH",
"side": "sell",
"price": "2600.00",
"size": "2.0",
"filledSize": "0",
"status": "cancelled",
"time": 1704355300000
},
{
"oid": "23671238460",
"coin": "ETH",
"side": "buy",
"price": "2500.30",
"size": "1.5",
"filledSize": "1.5",
"status": "filled",
"time": 1704355200000
}
]
}
根据订单ID获取订单
根据订单 ID (oid) 获取指定订单详情。如不存在或未成交返回 null。
路径参数
- Name
oid- Type
- string
- Description
订单 ID,如
23671238460
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- object
- Description
订单详情,如不存在返回 null
请求
curl -G https://open.aicoin.com/v2/hl/orders/oid/23671238460 \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": {
"oid": "23671238460",
"coin": "ETH",
"side": "buy",
"price": "2500.30",
"size": "1.5",
"filledSize": "1.5",
"status": "filled",
"time": 1704355200000
}
}
获取账户价值曲线和PNL曲线
获取指定时间窗口的账户价值曲线和 PNL 曲线数据。
路径参数
- Name
address- Type
- string
- Description
用户钱包地址,如
0x0089xxx
- Name
window- Type
- string
- Description
时间窗口,可选值:
day、week、month、allTime
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- object
- Description
包含账户价值曲线和 PNL 曲线的数据
请求
curl -G https://open.aicoin.com/v2/hl/portfolio/0x0089xxx/week \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": {
"accountValue": [
{"time": 1704268800000, "value": "10000.00"},
{"time": 1704355200000, "value": "10500.00"}
],
"pnl": [
{"time": 1704268800000, "value": "0.00"},
{"time": 1704355200000, "value": "500.00"}
]
}
}
获取PNL曲线
获取指定周期的 PNL 曲线数据。
路径参数
- Name
address- Type
- string
- Description
用户钱包地址,如
0x0089xxx
查询参数
- Name
period- Type
- integer
- Description
周期天数,默认 0。可选值:
0(allTime)、1、7、30
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
PNL 曲线数据数组
请求
curl -G "https://open.aicoin.com/v2/hl/pnls/0x0089xxx?period=7" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{"time": 1704268800000, "pnl": "0.00"},
{"time": 1704355200000, "pnl": "500.00"},
{"time": 1704441600000, "pnl": "750.00"}
]
}
获取收益最高的交易
获取周期内完成的收益最高的交易(仓位)列表。
路径参数
- Name
address- Type
- string
- Description
用户钱包地址,如
0xfe00xxx
查询参数
- Name
period- Type
- integer
- Description
周期天数
- Name
limit- Type
- integer
- Description
返回记录数量限制,默认 10
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
收益最高的交易列表
请求
curl -G "https://open.aicoin.com/v2/hl/traders/0xfe00xxx/best-trades?limit=10&period=30" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"coin": "ETH",
"side": "long",
"entryPrice": "2400.00",
"exitPrice": "2600.00",
"pnl": "2000.00",
"pnlPercent": "8.33",
"openTime": 1704268800000,
"closeTime": 1704355200000
}
]
}
获取分币种交易统计
对周期内完成的交易分币种统计。
路径参数
- Name
address- Type
- string
- Description
用户钱包地址,如
0xfe00xxx
查询参数
- Name
period- Type
- integer
- Description
周期天数
- Name
limit- Type
- integer
- Description
返回记录数量限制,默认 10
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
分币种的交易统计数据
请求
curl -G "https://open.aicoin.com/v2/hl/traders/0xfe00xxx/performance-by-coin?limit=10&period=7" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"coin": "ETH",
"tradeCount": 15,
"winCount": 10,
"lossCount": 5,
"winRate": "66.67",
"totalPnl": "5000.00",
"avgPnl": "333.33"
},
{
"coin": "BTC",
"tradeCount": 8,
"winCount": 5,
"lossCount": 3,
"winRate": "62.50",
"totalPnl": "3000.00",
"avgPnl": "375.00"
}
]
}
获取交易统计
对周期内完成的交易的统计数据。
路径参数
- Name
address- Type
- string
- Description
用户钱包地址,如
0xfe00xxx
查询参数
- Name
period- Type
- integer
- Description
周期天数
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- object
- Description
交易统计数据
请求
curl -G "https://open.aicoin.com/v2/hl/traders/0xfe00xxx/addr-stat?period=7" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": {
"tradeCount": 23,
"winCount": 15,
"lossCount": 8,
"winRate": "65.22",
"totalPnl": "8000.00",
"avgPnl": "347.83",
"maxProfit": "2000.00",
"maxLoss": "-500.00"
}
}
获取已完成交易列表
查询最新完成的交易(仓位)列表。
路径参数
- Name
address- Type
- string
- Description
用户钱包地址,如
0xfe00xxx
查询参数
- Name
coin- Type
- string
- Description
可选,筛选指定币种
- Name
limit- Type
- integer
- Description
返回记录数量限制,默认 100
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
已完成交易列表
请求
curl -G "https://open.aicoin.com/v2/hl/traders/0xfe00xxx/completed-trades?limit=2000" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"coin": "ETH",
"side": "long",
"entryPrice": "2400.00",
"exitPrice": "2600.00",
"size": "10.0",
"pnl": "2000.00",
"pnlPercent": "8.33",
"openTime": 1704268800000,
"closeTime": 1704355200000
},
{
"coin": "BTC",
"side": "short",
"entryPrice": "43000.00",
"exitPrice": "42500.00",
"size": "0.5",
"pnl": "250.00",
"pnlPercent": "1.16",
"openTime": 1704182400000,
"closeTime": 1704268800000
}
]
}
批量查询账户信息
查询多个地址的账户情况。
请求体参数
- Name
addresses- Type
- array
- Description
地址列表,最多 50 个地址
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
账户信息列表
请求
curl -X POST "https://open.aicoin.com/v2/hl/traders/accounts?AccessKeyId=YOUR_ACCESS_KEY_ID&SignatureNonce=RANDOM_NONCE&Timestamp=CURRENT_TIMESTAMP&Signature=YOUR_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{
"addresses": [
"0xfe00xxx",
"0xaf72xxx"
]
}'
响应
{
"code": "0",
"msg": "success",
"data": [
{
"address": "0xfe00xxx",
"accountValue": "50000.00",
"totalPnl": "5000.00",
"totalPnlPercent": "10.00"
},
{
"address": "0xaf72xxx",
"accountValue": "30000.00",
"totalPnl": "3000.00",
"totalPnlPercent": "10.00"
}
]
}
批量查询交易统计
查询多个地址的指定周期的交易统计。
请求体参数
- Name
period- Type
- integer
- Description
周期天数,如 7 表示最近7天
- Name
pnlList- Type
- boolean
- Description
是否需要 pnl 曲线数据
- Name
addresses- Type
- array
- Description
地址列表,最多 50 个地址
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
交易统计数据列表
请求
curl -X POST "https://open.aicoin.com/v2/hl/traders/statistics?AccessKeyId=YOUR_ACCESS_KEY_ID&SignatureNonce=RANDOM_NONCE&Timestamp=CURRENT_TIMESTAMP&Signature=YOUR_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{
"period": 7,
"pnlList": false,
"addresses": [
"0xfe00xxx",
"0xaf72xxx"
]
}'
响应
{
"code": "0",
"msg": "success",
"data": [
{
"address": "0xfe00xxx",
"tradeCount": 23,
"winCount": 15,
"lossCount": 8,
"winRate": "65.22",
"totalPnl": "8000.00",
"avgPnl": "347.83"
},
{
"address": "0xaf72xxx",
"tradeCount": 10,
"winCount": 7,
"lossCount": 3,
"winRate": "70.00",
"totalPnl": "5000.00",
"avgPnl": "500.00"
}
]
}
获取鲸鱼仓位事件
获取最新鲸鱼仓位事件。
查询参数
- Name
limit- Type
- integer
- Description
可选,返回记录数量限制,默认 10
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
鲸鱼仓位事件列表
请求
curl -G "https://open.aicoin.com/v2/hl/whales/latest-events?limit=10" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"address": "0xfe00xxx",
"coin": "ETH",
"event": "open",
"dir": "long",
"size": "1000.0",
"price": "2500.00",
"positionValue": "2500000.00",
"time": 1704355200000
}
]
}
获取鲸鱼仓位多空数
获取当前鲸鱼仓位多空数统计。
查询参数
- Name
coin- Type
- string
- Description
可选,筛选指定币种,如
ETH、BTC
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- object
- Description
多空数统计数据
请求
curl -G "https://open.aicoin.com/v2/hl/whales/directions?coin=ETH" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": {
"longCount": 45,
"shortCount": 32,
"longValue": "125000000.00",
"shortValue": "85000000.00"
}
}
获取强平统计
获取最近强平/强减统计数据。
查询参数
- Name
coin- Type
- string
- Description
可选,筛选指定币种,如
ETH、BTC
- Name
interval- Type
- string
- Description
可选,时间间隔,默认
1d。可选值:1m、5m、15m、30m、1h、4h、1d
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- object
- Description
强平统计数据
请求
curl -G "https://open.aicoin.com/v2/hl/liquidations/stat?coin=BTC&interval=15m" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": {
"coin": "BTC",
"interval": "15m",
"longLiquidations": 15,
"shortLiquidations": 8,
"longValue": "2500000.00",
"shortValue": "1200000.00",
"totalValue": "3700000.00"
}
}
获取强平统计(分币种)
获取最近强平/强减统计数据,按币种分组。
查询参数
- Name
interval- Type
- string
- Description
可选,时间间隔,默认
1d。可选值:1m、5m、15m、30m、1h、4h、1d
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
按币种分组的强平统计数据
请求
curl -G "https://open.aicoin.com/v2/hl/liquidations/stat-by-coin?interval=15m" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"coin": "BTC",
"longLiquidations": 15,
"shortLiquidations": 8,
"longValue": "2500000.00",
"shortValue": "1200000.00"
},
{
"coin": "ETH",
"longLiquidations": 22,
"shortLiquidations": 18,
"longValue": "1800000.00",
"shortValue": "1500000.00"
}
]
}
获取强平历史
获取强平历史数据,按周期分组。
查询参数
- Name
coin- Type
- string
- Description
可选,筛选指定币种,如
ETH、BTC
- Name
interval- Type
- string
- Description
可选,时间间隔,默认
1d。可选值:1m、5m、15m、30m、1h、4h、1d
- Name
limit- Type
- integer
- Description
可选,返回记录数量限制
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
强平历史数据
请求
curl -G "https://open.aicoin.com/v2/hl/liquidations/history?coin=BTC&interval=15m&limit=10" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"time": 1704355200000,
"coin": "BTC",
"longLiquidations": 5,
"shortLiquidations": 3,
"longValue": "850000.00",
"shortValue": "420000.00"
},
{
"time": 1704354300000,
"coin": "BTC",
"longLiquidations": 8,
"shortLiquidations": 2,
"longValue": "1200000.00",
"shortValue": "280000.00"
}
]
}
发现聪明钱地址
发现聪明钱地址,支持多种排序方式筛选。
请求体参数
- Name
period- Type
- integer
- Description
周期天数,如 7 表示最近7天
- Name
sort- Type
- string
- Description
排序方式,可选值:
win-rate(胜率)、account-balance(账户余额)、ROI(收益率)、pnl(盈亏)、position-count(持仓数量)、profit-count(盈利次数)、last-operation(最后操作时间)、avg-holding-period(平均持仓周期)、current-position(当前持仓)
- Name
pnlList- Type
- boolean
- Description
是否需要 pnl 曲线数据
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
聪明钱地址列表
请求
curl -X POST "https://open.aicoin.com/v2/hl/smart/find?AccessKeyId=YOUR_ACCESS_KEY_ID&SignatureNonce=RANDOM_NONCE&Timestamp=CURRENT_TIMESTAMP&Signature=YOUR_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{
"period": 7,
"sort": "win-rate",
"pnlList": false
}'
响应
{
"code": "0",
"msg": "success",
"data": [
{
"address": "0xfe00xxx",
"winRate": "75.50",
"accountBalance": "150000.00",
"roi": "25.30",
"pnl": "37500.00",
"positionCount": 5,
"profitCount": 38,
"lastOperation": 1704355200000,
"avgHoldingPeriod": "2.5"
},
{
"address": "0xaf72xxx",
"winRate": "72.00",
"accountBalance": "80000.00",
"roi": "18.50",
"pnl": "14800.00",
"positionCount": 3,
"profitCount": 18,
"lastOperation": 1704268800000,
"avgHoldingPeriod": "1.8"
}
]
}
查询鲸鱼仓位
查询当前鲸鱼仓位。鲸鱼定义为仓位价值大于100万美元的地址。
查询参数
- Name
coin- Type
- string
- Description
可选,筛选指定币种,如
ETH、BTC
- Name
dir- Type
- string
- Description
可选,筛选方向,可选值:
long(多头)、short(空头)
- Name
npnl-side- Type
- string
- Description
可选,浮盈/浮亏筛选,可选值:
profit(浮盈)、loss(浮亏)
- Name
fr-side- Type
- string
- Description
可选,资金费盈亏筛选,可选值:
profit(盈)、loss(亏)
- Name
top-by- Type
- string
- Description
可选,排序方式,可选值:
position-value(仓位价值)、margin-balance(保证金余额)、create-time(创建时间)、profit(盈利)、loss(亏损)。默认create-time(倒序)
- Name
take- Type
- integer
- Description
可选,返回记录数量限制
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- array
- Description
鲸鱼仓位列表
请求
curl -G "https://open.aicoin.com/v2/hl/whales/open-positions?take=10&coin=ETH&top-by=create-time" \
-d "AccessKeyId=YOUR_ACCESS_KEY_ID" \
-d "SignatureNonce=RANDOM_NONCE" \
-d "Timestamp=CURRENT_TIMESTAMP" \
-d "Signature=YOUR_SIGNATURE"
响应
{
"code": "0",
"msg": "success",
"data": [
{
"address": "0xfe00xxx",
"coin": "ETH",
"dir": "long",
"positionValue": "2500000.00",
"marginBalance": "500000.00",
"entryPrice": "2400.00",
"markPrice": "2600.00",
"size": "1000.0",
"leverage": "5.0",
"npnl": "200000.00",
"npnlPercent": "8.33",
"fundingRate": "0.01",
"frPnl": "2500.00",
"createTime": 1704268800000
},
{
"address": "0xaf72xxx",
"coin": "ETH",
"dir": "short",
"positionValue": "1500000.00",
"marginBalance": "300000.00",
"entryPrice": "2650.00",
"markPrice": "2600.00",
"size": "576.9",
"leverage": "5.0",
"npnl": "28845.00",
"npnlPercent": "1.92",
"fundingRate": "0.01",
"frPnl": "-1500.00",
"createTime": 1704182400000
}
]
}
Info API 统一端点
Hyperliquid Info API 统一端点,与官方 API 格式一致。通过请求体中的 type 字段指定要查询的数据类型。
请求体参数
- Name
type- Type
- string
- Description
请求类型,支持以下值:
meta: 获取永续合约元数据spotMeta: 获取现货元数据clearinghouseState: 获取用户永续合约账户状态(需要 user)spotClearinghouseState: 获取用户现货账户状态(需要 user)openOrders: 获取用户挂单(需要 user)frontendOpenOrders: 获取用户挂单-前端格式(需要 user)userFees: 获取用户手续费(需要 user)userFills: 获取用户成交记录(需要 user)userFillsByTime: 获取用户指定时间范围成交记录(需要 user, startTime)candleSnapshot: 获取K线数据(需要 req)perpDexs: 获取永续DEX列表activeAssetData: 获取活跃资产数据(需要 user, coin)webData2: 获取Web数据(需要 user)historicalOrders: 获取历史订单(需要 user)userTwapSliceFills: 获取用户TWAP切片成交(需要 user)orderStatus: 获取订单状态(需要 user, oid)userFunding: 获取用户资金费用历史(需要 user, startTime)userNonFundingLedgerUpdates: 获取用户非资金费账本更新(需要 user, startTime)
- Name
user- Type
- string
- Description
用户钱包地址,部分 type 需要此参数
- Name
startTime- Type
- integer
- Description
开始时间(毫秒),部分 type 需要此参数
- Name
endTime- Type
- integer
- Description
结束时间(毫秒),可选
- Name
coin- Type
- string
- Description
币种名称,部分 type 需要此参数
- Name
oid- Type
- integer|string
- Description
订单ID,orderStatus 类型需要此参数
- Name
dex- Type
- string
- Description
DEX名称,frontendOpenOrders 类型可选
- Name
aggregateByTime- Type
- boolean
- Description
是否按时间聚合,userFills/userFillsByTime 类型可选
- Name
req- Type
- object
- Description
candleSnapshot 专用请求体,包含 coin、interval、startTime、endTime
请求参数
- Name
AccessKeyId- Type
- string
- Description
用户访问密钥ID
- Name
SignatureNonce- Type
- string
- Description
签名随机数
- Name
Timestamp- Type
- string
- Description
请求时间戳(秒),有效期30秒
- Name
Signature- Type
- string
- Description
使用 HmacSHA1 + Base64 生成的签名,请参考如何获取 API 认证参数
返回数据
- Name
code- Type
- string
- Description
状态码,"0" 表示成功
- Name
msg- Type
- string
- Description
响应消息
- Name
data- Type
- object|array
- Description
返回数据,格式根据 type 不同而不同
请求示例
curl -X POST "https://open.aicoin.com/v2/hl/info?AccessKeyId=YOUR_ACCESS_KEY_ID&SignatureNonce=RANDOM_NONCE&Timestamp=CURRENT_TIMESTAMP&Signature=YOUR_SIGNATURE" \
-H "Content-Type: application/json" \
-d '{"type": "meta"}'
响应示例 (meta)
{
"code": "0",
"msg": "success",
"data": {
"universe": [
{
"name": "BTC",
"szDecimals": 5,
"maxLeverage": 50
},
{
"name": "ETH",
"szDecimals": 4,
"maxLeverage": 50
}
]
}
}
错误码说明
| 错误码 | 说明 |
|---|---|
| 0 | 成功 |
| 400 | 请求参数错误 |
| 401 | 未授权,API Key 无效或缺失 |
| 403 | 无权限访问该接口 |
| 500 | 服务器内部错误 |