List margin positions
curl --request GET \
--url https://api.worm.wtf/margin/positions/import requests
url = "https://api.worm.wtf/margin/positions/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.worm.wtf/margin/positions/', 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.worm.wtf/margin/positions/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.worm.wtf/margin/positions/"
req, _ := http.NewRequest("GET", url, nil)
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.worm.wtf/margin/positions/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.worm.wtf/margin/positions/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"pubkey": "8pT3nW6kQ1rM9yB4cL7vF2zX5uJ0eR3sN6dQ2mP8tHy",
"position_request_pubkey": "4mD8rQ2xT7pL1vN6yB3kC9sW5uF0zJ4eR8nM2qP6tLy",
"market": {
"title": "Will the Atlanta Hawks beat the New York Knicks in the NBA game on April 28, 2026?",
"condition_id": "7n9G9WfQ2V7d6hM3XK8pQ4LwR2eY6aT1uJ5cB8mN3qPz",
"logo": "https://cdn.worm.wtf/m/123.png",
"last_trade_price": "0.68",
"event": {
"title": "NBA Apr 28, 2026",
"condition_id": "9x4H2LdQ7sM1Kp6Wv3Tn8YfR5aC2uJ7mB4eQ9zN6dLp",
"logo": "https://cdn.worm.wtf/e/42.png"
}
},
"is_yes": true,
"leverage": "3.000000",
"total_shares": "210.000000",
"avg_entry_price": "0.64",
"closing_price": null,
"unrealized_pnl": "37.20",
"realized_pnl": "0",
"user_liquidity": "100.000000",
"total_liquidity": "300.000000",
"liquidation_price": "0.400000",
"is_closed": false,
"is_liquidated": false,
"is_claimed": false,
"tp_sl": {
"take_profit_price": "0.75",
"stop_loss_price": "0.58",
"state": "active",
"trigger_type": null,
"triggered_price": null,
"triggered_at": null
},
"created": 1714300800
}
],
"meta": {
"limit": 50,
"next_cursor": "eyJwdWJrZXkiOiI4cFQzblc2a1Exck05eUI0Y0w3dkYyelg1dUowZVIzc042ZFEybVA4dEh5Iiwic29ydF92YWx1ZSI6MTcxNDMwMDgwMH0"
},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -12,
"slug": "authentication_failed",
"message": "Invalid signature",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -14,
"slug": "permission_denied",
"message": "You do not have permission to perform this action.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -17,
"slug": "throttled",
"message": "Request was throttled.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -3,
"slug": "internal_error",
"message": "An internal error occurred.",
"details": []
}
}
Margin
List margin positions
Retrieve your active and historical margin positions with optional filters.
GET
/
margin
/
positions
/
List margin positions
curl --request GET \
--url https://api.worm.wtf/margin/positions/import requests
url = "https://api.worm.wtf/margin/positions/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.worm.wtf/margin/positions/', 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.worm.wtf/margin/positions/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.worm.wtf/margin/positions/"
req, _ := http.NewRequest("GET", url, nil)
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.worm.wtf/margin/positions/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.worm.wtf/margin/positions/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"pubkey": "8pT3nW6kQ1rM9yB4cL7vF2zX5uJ0eR3sN6dQ2mP8tHy",
"position_request_pubkey": "4mD8rQ2xT7pL1vN6yB3kC9sW5uF0zJ4eR8nM2qP6tLy",
"market": {
"title": "Will the Atlanta Hawks beat the New York Knicks in the NBA game on April 28, 2026?",
"condition_id": "7n9G9WfQ2V7d6hM3XK8pQ4LwR2eY6aT1uJ5cB8mN3qPz",
"logo": "https://cdn.worm.wtf/m/123.png",
"last_trade_price": "0.68",
"event": {
"title": "NBA Apr 28, 2026",
"condition_id": "9x4H2LdQ7sM1Kp6Wv3Tn8YfR5aC2uJ7mB4eQ9zN6dLp",
"logo": "https://cdn.worm.wtf/e/42.png"
}
},
"is_yes": true,
"leverage": "3.000000",
"total_shares": "210.000000",
"avg_entry_price": "0.64",
"closing_price": null,
"unrealized_pnl": "37.20",
"realized_pnl": "0",
"user_liquidity": "100.000000",
"total_liquidity": "300.000000",
"liquidation_price": "0.400000",
"is_closed": false,
"is_liquidated": false,
"is_claimed": false,
"tp_sl": {
"take_profit_price": "0.75",
"stop_loss_price": "0.58",
"state": "active",
"trigger_type": null,
"triggered_price": null,
"triggered_at": null
},
"created": 1714300800
}
],
"meta": {
"limit": 50,
"next_cursor": "eyJwdWJrZXkiOiI4cFQzblc2a1Exck05eUI0Y0w3dkYyelg1dUowZVIzc042ZFEybVA4dEh5Iiwic29ydF92YWx1ZSI6MTcxNDMwMDgwMH0"
},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -12,
"slug": "authentication_failed",
"message": "Invalid signature",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -14,
"slug": "permission_denied",
"message": "You do not have permission to perform this action.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -17,
"slug": "throttled",
"message": "Request was throttled.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -3,
"slug": "internal_error",
"message": "An internal error occurred.",
"details": []
}
}
Query Parameters
string
Filter positions by market condition id.
boolean
Filter by closed/open position state.
string
default:"-created"
Exactly
created or -created (default -created).integer
default:"50"
Number of records to return. Range: 1-100.
string
Opaque cursor from
meta.next_cursor. See Pagination.Response
array
Margin position rows.
Show Data fields
Show Data fields
string
Position public key.
string | null
Originating request public key.
object
Market reference.
boolean
Position side.
string
Leverage.
string
Total shares.
string
Average entry price.
string | null
Unrealized PnL.
boolean
Closed state.
string | null
Close price when the position is flat/closed.
string
Realized PnL.
string
User-posted liquidity for the position.
string
Total liquidity for the position.
string
Liquidation price.
boolean
Whether the position was liquidated.
boolean
Whether proceeds were claimed when applicable.
object | null
TP/SL row:
take_profit_price, stop_loss_price, state, trigger_type, triggered_price, triggered_at (see Set TP/SL).integer | null
Created timestamp (unix seconds).
object | null
Pagination for this list:
limit and next_cursor. See Pagination. On error responses, meta is null.object | null
null on success. Error object on failed requests.{
"data": [
{
"pubkey": "8pT3nW6kQ1rM9yB4cL7vF2zX5uJ0eR3sN6dQ2mP8tHy",
"position_request_pubkey": "4mD8rQ2xT7pL1vN6yB3kC9sW5uF0zJ4eR8nM2qP6tLy",
"market": {
"title": "Will the Atlanta Hawks beat the New York Knicks in the NBA game on April 28, 2026?",
"condition_id": "7n9G9WfQ2V7d6hM3XK8pQ4LwR2eY6aT1uJ5cB8mN3qPz",
"logo": "https://cdn.worm.wtf/m/123.png",
"last_trade_price": "0.68",
"event": {
"title": "NBA Apr 28, 2026",
"condition_id": "9x4H2LdQ7sM1Kp6Wv3Tn8YfR5aC2uJ7mB4eQ9zN6dLp",
"logo": "https://cdn.worm.wtf/e/42.png"
}
},
"is_yes": true,
"leverage": "3.000000",
"total_shares": "210.000000",
"avg_entry_price": "0.64",
"closing_price": null,
"unrealized_pnl": "37.20",
"realized_pnl": "0",
"user_liquidity": "100.000000",
"total_liquidity": "300.000000",
"liquidation_price": "0.400000",
"is_closed": false,
"is_liquidated": false,
"is_claimed": false,
"tp_sl": {
"take_profit_price": "0.75",
"stop_loss_price": "0.58",
"state": "active",
"trigger_type": null,
"triggered_price": null,
"triggered_at": null
},
"created": 1714300800
}
],
"meta": {
"limit": 50,
"next_cursor": "eyJwdWJrZXkiOiI4cFQzblc2a1Exck05eUI0Y0w3dkYyelg1dUowZVIzc042ZFEybVA4dEh5Iiwic29ydF92YWx1ZSI6MTcxNDMwMDgwMH0"
},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -12,
"slug": "authentication_failed",
"message": "Invalid signature",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -14,
"slug": "permission_denied",
"message": "You do not have permission to perform this action.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -17,
"slug": "throttled",
"message": "Request was throttled.",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": -3,
"slug": "internal_error",
"message": "An internal error occurred.",
"details": []
}
}