Get margin position by pubkey
curl --request GET \
--url https://api.worm.wtf/margin/positions/{pubkey}/import requests
url = "https://api.worm.wtf/margin/positions/{pubkey}/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.worm.wtf/margin/positions/{pubkey}/', 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/{pubkey}/",
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/{pubkey}/"
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/{pubkey}/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.worm.wtf/margin/positions/{pubkey}/")
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": null,
"last_trade_price": "0.68",
"event": null
},
"is_yes": true,
"leverage": "3.000000",
"total_shares": "210.000000",
"avg_entry_price": "0.64",
"closing_price": null,
"realized_pnl": "0.00",
"unrealized_pnl": "37.20",
"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": {},
"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": -15,
"slug": "not_found",
"message": "Not found.",
"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
Get margin position by pubkey
Retrieve detailed information for a single margin position.
GET
/
margin
/
positions
/
{pubkey}
/
Get margin position by pubkey
curl --request GET \
--url https://api.worm.wtf/margin/positions/{pubkey}/import requests
url = "https://api.worm.wtf/margin/positions/{pubkey}/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.worm.wtf/margin/positions/{pubkey}/', 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/{pubkey}/",
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/{pubkey}/"
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/{pubkey}/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.worm.wtf/margin/positions/{pubkey}/")
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": null,
"last_trade_price": "0.68",
"event": null
},
"is_yes": true,
"leverage": "3.000000",
"total_shares": "210.000000",
"avg_entry_price": "0.64",
"closing_price": null,
"realized_pnl": "0.00",
"unrealized_pnl": "37.20",
"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": {},
"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": -15,
"slug": "not_found",
"message": "Not found.",
"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": []
}
}
Path Parameters
string
required
The public key of the margin position to retrieve.
Response
object
Single margin position row.
Show Data fields
Show Data fields
string
Position public key.
string | null
Originating request public key.
object
Market summary (
title, condition_id, logo, last_trade_price, nested event).boolean
Position side.
string
Leverage.
string
Total shares.
string
Average entry price.
string | null
Close price when the position is flat/closed.
string
Realized PnL.
string | null
Unrealized PnL.
string
User-posted liquidity for the position.
string
Total liquidity for the position.
string
Liquidation price.
boolean
Closed state.
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.integer | null
Created timestamp (unix seconds).
object
Empty object on success for this endpoint.
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": null,
"last_trade_price": "0.68",
"event": null
},
"is_yes": true,
"leverage": "3.000000",
"total_shares": "210.000000",
"avg_entry_price": "0.64",
"closing_price": null,
"realized_pnl": "0.00",
"unrealized_pnl": "37.20",
"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": {},
"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": -15,
"slug": "not_found",
"message": "Not found.",
"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": []
}
}