curl --request POST \
--url https://api.hyperliquid.xyz/exchange \
--header 'Content-Type: application/json' \
--data '{
"action": {
"type": "spotUser",
"classTransfer": {
"usdc": "250.000000",
"toPerp": true
}
},
"nonce": 1705234567890,
"signature": {
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321",
"v": 27
},
"vaultAddress": null
}'
{
"status": "ok",
"response": {
"type": "spotUser",
"data": {
"status": "success"
}
}
}
curl --request POST \
--url https://api.hyperliquid.xyz/exchange \
--header 'Content-Type: application/json' \
--data '{
"action": {
"type": "spotUser",
"classTransfer": {
"usdc": "250.000000",
"toPerp": true
}
},
"nonce": 1705234567890,
"signature": {
"r": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"s": "0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321",
"v": 27
},
"vaultAddress": null
}'
{
"status": "ok",
"response": {
"type": "spotUser",
"data": {
"status": "success"
}
}
}
action
(object, required) — The transfer action object containing:
type
(string) — Must be "spotUser"
classTransfer
(object) — Transfer details:
usdc
(number) — Amount to transfer in USDC with 6 decimals (e.g., 100000000 = 100 USDC)toPerp
(boolean) — Direction of transfer:
true
— Transfer from spot to perpfalse
— Transfer from perp to spotnonce
(number, required) — Current timestamp in milliseconds (must be recent)
signature
(object, required) — EIP-712 signature of the action
vaultAddress
(string, optional) — Address when trading on behalf of a vault or subaccountexpiresAfter
(number, optional) — Timestamp in milliseconds after which the request is rejectedtoPerp: true
)
toPerp: false
)
status
— "ok"
if successfulresponse
— Contains transfer details:
type
— "default"
# Transfer 100 USDC from spot to perp
curl -X POST https://api.hyperliquid.xyz/exchange \
-H "Content-Type: application/json" \
-d '{
"action": {
"type": "spotUser",
"classTransfer": {
"usdc": 100000000,
"toPerp": true
}
},
"nonce": 1234567890123,
"signature": {...}
}'
# Transfer 50 USDC from perp to spot
curl -X POST https://api.hyperliquid.xyz/exchange \
-H "Content-Type: application/json" \
-d '{
"action": {
"type": "spotUser",
"classTransfer": {
"usdc": 50000000,
"toPerp": false
}
},
"nonce": 1234567890123,
"signature": {...}
}'
{
"status": "ok",
"response": {
"type": "default"
}
}
Spot/Perp transfer result
The response is of type object
.