Wallet flows
curl --request GET \
--url https://api.polynode.dev/v3/perps/wallets/{address}/flows \
--header 'x-api-key: <api-key>'import requests
url = "https://api.polynode.dev/v3/perps/wallets/{address}/flows"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.polynode.dev/v3/perps/wallets/{address}/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.polynode.dev/v3/perps/wallets/{address}/flows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.polynode.dev/v3/perps/wallets/{address}/flows"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.polynode.dev/v3/perps/wallets/{address}/flows")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polynode.dev/v3/perps/wallets/{address}/flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"deposit_count": 13,
"deposited_usd": "2656777.090896",
"events": [
{
"block": 89996562,
"kind": "deposit",
"timestamp": 1783699584000,
"usd": "52978.15075"
},
{
"block": 89824544,
"kind": "deposit",
"timestamp": 1783374238000,
"usd": "117553.8245"
}
],
"has_more": false,
"net_usd": "2656777.090896",
"next_cursor": null,
"signer": "0xe666b1fed887af4c9cb8e8f6feb7fc1c537e74a5",
"withdrawal_count": 0,
"withdrawn_usd": "0"
}{
"error": "invalid cursor"
}Perps On-Chain
Wallet Flows
One wallet’s collateral flow: total deposited, withdrawn, net, and stable pages of deposit or withdrawal events. Resolved to the signer. Totals and counts remain fixed across pages in one traversal.
GET
/
v3
/
perps
/
wallets
/
{address}
/
flows
Wallet flows
curl --request GET \
--url https://api.polynode.dev/v3/perps/wallets/{address}/flows \
--header 'x-api-key: <api-key>'import requests
url = "https://api.polynode.dev/v3/perps/wallets/{address}/flows"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.polynode.dev/v3/perps/wallets/{address}/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.polynode.dev/v3/perps/wallets/{address}/flows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.polynode.dev/v3/perps/wallets/{address}/flows"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.polynode.dev/v3/perps/wallets/{address}/flows")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polynode.dev/v3/perps/wallets/{address}/flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"deposit_count": 13,
"deposited_usd": "2656777.090896",
"events": [
{
"block": 89996562,
"kind": "deposit",
"timestamp": 1783699584000,
"usd": "52978.15075"
},
{
"block": 89824544,
"kind": "deposit",
"timestamp": 1783374238000,
"usd": "117553.8245"
}
],
"has_more": false,
"net_usd": "2656777.090896",
"next_cursor": null,
"signer": "0xe666b1fed887af4c9cb8e8f6feb7fc1c537e74a5",
"withdrawal_count": 0,
"withdrawn_usd": "0"
}{
"error": "invalid cursor"
}One wallet’s collateral history: total deposited, total withdrawn, net, and
pages of deposit and withdrawal events. Any supported address form resolves to
the signer automatically.
Responses include
The deposit and withdrawal totals and counts stay identical on every page in
one traversal. Cursors expire after 24 hours. A malformed cursor returns HTTP
has_more and an opaque next_cursor. Send that value as
cursor for the same wallet to continue through the fixed traversal:
GET /v3/perps/wallets/0xabc/flows?limit=100
GET /v3/perps/wallets/0xabc/flows?limit=100&cursor=<next_cursor>
400 with {"error":"invalid cursor"}. An expired cursor returns
{"error":"cursor has expired"}. Reusing a cursor for another wallet returns
HTTP 400 with a clean mismatch message. Start again without the cursor in
each case.
