Get a user's PnL series
curl --request GET \
--url https://data-api.polymarket.com/v2/user-pnl \
--header 'Authorization: Bearer <token>'import requests
url = "https://data-api.polymarket.com/v2/user-pnl"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://data-api.polymarket.com/v2/user-pnl', 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://data-api.polymarket.com/v2/user-pnl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://data-api.polymarket.com/v2/user-pnl"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data-api.polymarket.com/v2/user-pnl")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data-api.polymarket.com/v2/user-pnl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"fidelity": "<string>",
"interval": "<string>",
"points": [
{
"realized_combo_pnl": 123,
"realized_lp_pnl": 123,
"realized_market_pnl": 123,
"realized_pnl": 123,
"source_block": 123,
"timestamp": 123,
"trade_count": 1,
"volume": 123,
"volume_usdc": 123,
"cashflow_net": 123,
"deposits": 123,
"economic_pnl": 123,
"fees": 123,
"fees_paid": 123,
"fees_refunded": 123,
"maker_rebate": 123,
"position_pnl": 123,
"referral_income": 123,
"reward_income": 123,
"settled_pnl": 123,
"sponsored_income": 123,
"taker_rebate": 123,
"trade_pnl": 123,
"unrealized_pnl": 123,
"wallet_income": 123,
"withdrawals": 123,
"yield_income": 123
}
],
"proxy_wallet": "<string>",
"source_fidelity": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}获取用户盈亏曲线
Complete cumulative native-PnL atoms and compositions.
GET
/
v2
/
user-pnl
Get a user's PnL series
curl --request GET \
--url https://data-api.polymarket.com/v2/user-pnl \
--header 'Authorization: Bearer <token>'import requests
url = "https://data-api.polymarket.com/v2/user-pnl"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://data-api.polymarket.com/v2/user-pnl', 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://data-api.polymarket.com/v2/user-pnl",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://data-api.polymarket.com/v2/user-pnl"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data-api.polymarket.com/v2/user-pnl")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data-api.polymarket.com/v2/user-pnl")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"fidelity": "<string>",
"interval": "<string>",
"points": [
{
"realized_combo_pnl": 123,
"realized_lp_pnl": 123,
"realized_market_pnl": 123,
"realized_pnl": 123,
"source_block": 123,
"timestamp": 123,
"trade_count": 1,
"volume": 123,
"volume_usdc": 123,
"cashflow_net": 123,
"deposits": 123,
"economic_pnl": 123,
"fees": 123,
"fees_paid": 123,
"fees_refunded": 123,
"maker_rebate": 123,
"position_pnl": 123,
"referral_income": 123,
"reward_income": 123,
"settled_pnl": 123,
"sponsored_income": 123,
"taker_rebate": 123,
"trade_pnl": 123,
"unrealized_pnl": 123,
"wallet_income": 123,
"withdrawals": 123,
"yield_income": 123
}
],
"proxy_wallet": "<string>",
"source_fidelity": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
查询参数
Proxy wallet. The user_address spelling is accepted as an alias.
Window: max, all, 1m, 1w, 1d, 12h, or 6h. Defaults to 1d.
Output grid: 1d, 18h, 12h, 3h, or 1h. Defaults to 1h.
响应
Cumulative user-PnL series
{ "data": T }; the envelope for endpoints that don't paginate.
There is no pagination key: an aggregate or bounded list has no next page.
Paginated feeds return a *Page shape ({ data, pagination }) instead.
Complete v2 user-PnL response data.
Show child attributes
Show child attributes
此页面对您有帮助吗?