Update Leverage
curl --request PATCH \
--url https://api.perpetuals.polymarket.com/v1/trade/leverage \
--header 'Content-Type: application/json' \
--data '
{
"op": {
"type": "updateLeverage",
"args": {
"iid": 1,
"lev": 5,
"cross": false
}
},
"sig": "0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c",
"salt": 333333333,
"ts": 1767000012000
}
'import requests
url = "https://api.perpetuals.polymarket.com/v1/trade/leverage"
payload = {
"op": {
"type": "updateLeverage",
"args": {
"iid": 1,
"lev": 5,
"cross": False
}
},
"sig": "0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c",
"salt": 333333333,
"ts": 1767000012000
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
op: {type: 'updateLeverage', args: {iid: 1, lev: 5, cross: false}},
sig: '0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c',
salt: 333333333,
ts: 1767000012000
})
};
fetch('https://api.perpetuals.polymarket.com/v1/trade/leverage', 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.perpetuals.polymarket.com/v1/trade/leverage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'op' => [
'type' => 'updateLeverage',
'args' => [
'iid' => 1,
'lev' => 5,
'cross' => false
]
],
'sig' => '0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c',
'salt' => 333333333,
'ts' => 1767000012000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.perpetuals.polymarket.com/v1/trade/leverage"
payload := strings.NewReader("{\n \"op\": {\n \"type\": \"updateLeverage\",\n \"args\": {\n \"iid\": 1,\n \"lev\": 5,\n \"cross\": false\n }\n },\n \"sig\": \"0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c\",\n \"salt\": 333333333,\n \"ts\": 1767000012000\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.perpetuals.polymarket.com/v1/trade/leverage")
.header("Content-Type", "application/json")
.body("{\n \"op\": {\n \"type\": \"updateLeverage\",\n \"args\": {\n \"iid\": 1,\n \"lev\": 5,\n \"cross\": false\n }\n },\n \"sig\": \"0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c\",\n \"salt\": 333333333,\n \"ts\": 1767000012000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.perpetuals.polymarket.com/v1/trade/leverage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"op\": {\n \"type\": \"updateLeverage\",\n \"args\": {\n \"iid\": 1,\n \"lev\": 5,\n \"cross\": false\n }\n },\n \"sig\": \"0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c\",\n \"salt\": 333333333,\n \"ts\": 1767000012000\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"instrument_id": 1,
"leverage": 10,
"cross": true
}{
"status": "err",
"error": "insufficient_margin"
}{
"status": "err",
"error": "insufficient_margin"
}{
"status": "err",
"error": "insufficient_margin"
}{
"status": "err",
"error": "insufficient_margin"
}Update leverage for an instrument. Requires proxy signature, see proxy signing.
PATCH
/
v1
/
trade
/
leverage
Update Leverage
curl --request PATCH \
--url https://api.perpetuals.polymarket.com/v1/trade/leverage \
--header 'Content-Type: application/json' \
--data '
{
"op": {
"type": "updateLeverage",
"args": {
"iid": 1,
"lev": 5,
"cross": false
}
},
"sig": "0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c",
"salt": 333333333,
"ts": 1767000012000
}
'import requests
url = "https://api.perpetuals.polymarket.com/v1/trade/leverage"
payload = {
"op": {
"type": "updateLeverage",
"args": {
"iid": 1,
"lev": 5,
"cross": False
}
},
"sig": "0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c",
"salt": 333333333,
"ts": 1767000012000
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
op: {type: 'updateLeverage', args: {iid: 1, lev: 5, cross: false}},
sig: '0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c',
salt: 333333333,
ts: 1767000012000
})
};
fetch('https://api.perpetuals.polymarket.com/v1/trade/leverage', 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.perpetuals.polymarket.com/v1/trade/leverage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'op' => [
'type' => 'updateLeverage',
'args' => [
'iid' => 1,
'lev' => 5,
'cross' => false
]
],
'sig' => '0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c',
'salt' => 333333333,
'ts' => 1767000012000
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.perpetuals.polymarket.com/v1/trade/leverage"
payload := strings.NewReader("{\n \"op\": {\n \"type\": \"updateLeverage\",\n \"args\": {\n \"iid\": 1,\n \"lev\": 5,\n \"cross\": false\n }\n },\n \"sig\": \"0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c\",\n \"salt\": 333333333,\n \"ts\": 1767000012000\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.perpetuals.polymarket.com/v1/trade/leverage")
.header("Content-Type", "application/json")
.body("{\n \"op\": {\n \"type\": \"updateLeverage\",\n \"args\": {\n \"iid\": 1,\n \"lev\": 5,\n \"cross\": false\n }\n },\n \"sig\": \"0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c\",\n \"salt\": 333333333,\n \"ts\": 1767000012000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.perpetuals.polymarket.com/v1/trade/leverage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"op\": {\n \"type\": \"updateLeverage\",\n \"args\": {\n \"iid\": 1,\n \"lev\": 5,\n \"cross\": false\n }\n },\n \"sig\": \"0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c\",\n \"salt\": 333333333,\n \"ts\": 1767000012000\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"instrument_id": 1,
"leverage": 10,
"cross": true
}{
"status": "err",
"error": "insufficient_margin"
}{
"status": "err",
"error": "insufficient_margin"
}{
"status": "err",
"error": "insufficient_margin"
}{
"status": "err",
"error": "insufficient_margin"
}Request Weight: 1
Action Weight: 1
Body
application/json
Leverage request.
Show child attributes
Show child attributes
Signature in hex format
Example:
"0x1234567890..."
Salt
Example:
1234567890
Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).
Example:
1767225600000
Response
The instrument's effective leverage configuration after the update.
Was this page helpful?
⌘I