HTTP Endpoints
POST /info
HTTP endpoint for querying order book data. Your IP address must be whitelisted - authentication is automatic.
All Mids
Request mid prices for all trading pairs.
Request:{
"type": "allMids"
}{
"BTC": "97000.5",
"ETH": "3500.25",
...
}Returns a map of coin symbols to their mid prices as strings.
Impact Price
Calculate impact prices for a given coin and notional size.
Request:{
"type": "impactPrice",
"coin": "BTC",
"notional": "10000"
}| Field | Type | Required | Description |
|---|---|---|---|
type | string | yes | Must be "impactPrice" |
coin | string | yes | Trading pair (e.g., "BTC", "ETH") |
notional | string | yes | Notional size in USD |
{
"buyImpactPx": "97100.5",
"sellImpactPx": "96900.3",
"time": 1703271234000
}| Field | Type | Description |
|---|---|---|
buyImpactPx | string | null | Price to buy the notional amount (walk asks) |
sellImpactPx | string | null | Price to sell the notional amount (walk bids) |
time | number | Timestamp in milliseconds |
400 Bad Request- Invalid notional value500 Internal Server Error- Failed to process request
Example: cURL
All Mids
curl -X POST https://api.example.com/info \
-H "Content-Type: application/json" \
-d '{"type": "allMids"}'Impact Price
curl -X POST https://api.example.com/info \
-H "Content-Type: application/json" \
-d '{"type": "impactPrice", "coin": "BTC", "notional": "100000"}'IP Whitelist Management
Endpoints for managing IP whitelists. Requires signature authentication.
Authentication Header:Authorization: Signature ts=<timestamp>,sig=<signature>| Parameter | Type | Description |
|---|---|---|
ts | number | Unix timestamp in seconds (must be within 60s of server time) |
sig | string | Ethereum signature (hex with 0x prefix) |
Sign the message hfun-feed:<timestamp> with your Ethereum wallet. The signature must be from an address with an
active AlphaHype seat.
const timestamp = Math.floor(Date.now() / 1000);
const message = `hfun-feed:${timestamp}`;
const signature = await wallet.signMessage(message);
const headers = {
'Authorization': `Signature ts=${timestamp},sig=${signature}`,
'Content-Type': 'application/json'
};POST /ip/add
Add an IP address to the whitelist for the authenticated address.
Request:{
"ip": "203.0.113.42"
}| Field | Type | Required | Description |
|---|---|---|---|
ip | string | yes | IPv4 or IPv6 address to add |
{
"status": "ok",
"ip": "203.0.113.42"
}400 Bad Request- Invalid IP address format or IP already whitelisted401 Unauthorized- Invalid or missing signature403 Forbidden- Signer does not have an active seat, or max IPs per seat exceeded503 Service Unavailable- IP whitelist feature not enabled
POST /ip/remove
Remove an IP address from the whitelist for the authenticated address.
Request:{
"ip": "203.0.113.42"
}| Field | Type | Required | Description |
|---|---|---|---|
ip | string | yes | IPv4 or IPv6 address to remove |
{
"status": "ok",
"ip": "203.0.113.42"
}400 Bad Request- Invalid IP address format401 Unauthorized- Invalid or missing signature403 Forbidden- Signer does not have an active seat503 Service Unavailable- IP whitelist feature not enabled
POST /ip/list
List all whitelisted IP addresses for the authenticated address.
Request:Empty body or {}.
{
"ips": [
"203.0.113.42",
"198.51.100.10"
]
}401 Unauthorized- Invalid or missing signature403 Forbidden- Signer does not have an active seat503 Service Unavailable- IP whitelist feature not enabled
Example: IP Management with cURL
Add IP
curl -X POST https://api.example.com/ip/add \
-H "Content-Type: application/json" \
-H "Authorization: Signature ts=1234567890,sig=0x..." \
-d '{"ip": "203.0.113.42"}'Remove IP
curl -X POST https://api.example.com/ip/remove \
-H "Content-Type: application/json" \
-H "Authorization: Signature ts=1234567890,sig=0x..." \
-d '{"ip": "203.0.113.42"}'List IPs
curl -X POST https://api.example.com/ip/list \
-H "Content-Type: application/json" \
-H "Authorization: Signature ts=1234567890,sig=0x..." \
-d '{}'