Burn shares
curl --request POST \
--url https://relay.bayse.markets/v1/pm/markets/{marketId}/burn \
--header 'Content-Type: application/json' \
--data '
{
"quantity": 123,
"currency": "<string>"
}
'import requests
url = "https://relay.bayse.markets/v1/pm/markets/{marketId}/burn"
payload = {
"quantity": 123,
"currency": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({quantity: 123, currency: '<string>'})
};
fetch('https://relay.bayse.markets/v1/pm/markets/{marketId}/burn', 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://relay.bayse.markets/v1/pm/markets/{marketId}/burn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quantity' => 123,
'currency' => '<string>'
]),
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://relay.bayse.markets/v1/pm/markets/{marketId}/burn"
payload := strings.NewReader("{\n \"quantity\": 123,\n \"currency\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://relay.bayse.markets/v1/pm/markets/{marketId}/burn")
.header("Content-Type", "application/json")
.body("{\n \"quantity\": 123,\n \"currency\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://relay.bayse.markets/v1/pm/markets/{marketId}/burn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"quantity\": 123,\n \"currency\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"operationId": "e5f6a7b8-c9d0-1234-efab-567890123456",
"marketId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"quantity": 10,
"outcome1Price": 0.65,
"outcome2Price": 0.35,
"proceeds": 10.00
}
Trading
Burn shares
Destroy equal YES and NO shares and receive funds back
POST
/
v1
/
pm
/
markets
/
{marketId}
/
burn
Burn shares
curl --request POST \
--url https://relay.bayse.markets/v1/pm/markets/{marketId}/burn \
--header 'Content-Type: application/json' \
--data '
{
"quantity": 123,
"currency": "<string>"
}
'import requests
url = "https://relay.bayse.markets/v1/pm/markets/{marketId}/burn"
payload = {
"quantity": 123,
"currency": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({quantity: 123, currency: '<string>'})
};
fetch('https://relay.bayse.markets/v1/pm/markets/{marketId}/burn', 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://relay.bayse.markets/v1/pm/markets/{marketId}/burn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quantity' => 123,
'currency' => '<string>'
]),
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://relay.bayse.markets/v1/pm/markets/{marketId}/burn"
payload := strings.NewReader("{\n \"quantity\": 123,\n \"currency\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://relay.bayse.markets/v1/pm/markets/{marketId}/burn")
.header("Content-Type", "application/json")
.body("{\n \"quantity\": 123,\n \"currency\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://relay.bayse.markets/v1/pm/markets/{marketId}/burn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"quantity\": 123,\n \"currency\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"operationId": "e5f6a7b8-c9d0-1234-efab-567890123456",
"marketId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"quantity": 10,
"outcome1Price": 0.65,
"outcome2Price": 0.35,
"proceeds": 10.00
}
Burning is the reverse of minting. You surrender an equal number of YES and NO shares (a complementary pair) and receive funds back. Like minting, burning does not affect market prices since it removes both sides equally.
This is useful for exiting a position when you hold both outcomes, or for converting shares back to cash. You must hold sufficient shares of both YES and NO to burn.
Authentication
Write authentication required —X-Public-Key, X-Timestamp, and X-Signature headers. See the Authentication guide.
Path parameters
string
required
UUID of the market.
Request body
number
required
Amount to redeem from the burn operation in the selected
currency. For
example, quantity: 100, currency: "NGN" means “burn enough complete-set
inventory to receive 100 NGN”. Must be greater than 0.string
USD (default) or NGN.Request
quantity is a wallet amount in the provided currency. The response
quantity is the normalized share quantity burned.Example request
PUBLIC_KEY="pk_live_abcdef123456"
SECRET_KEY="sk_live_secret789xyz"
TIMESTAMP=$(date +%s)
METHOD="POST"
URL_PATH="/v1/pm/markets/b2c3d4e5-f6a7-8901-bcde-f12345678901/burn"
BODY='{"quantity":10,"currency":"USD"}'
BODY_HASH=$(printf '%s' "$BODY" | openssl dgst -sha256 -hex 2>/dev/null | sed 's/.*= //')
PAYLOAD="${TIMESTAMP}.${METHOD}.${URL_PATH}.${BODY_HASH}"
SIGNATURE=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET_KEY" -binary | base64)
curl -X POST "https://relay.bayse.markets${URL_PATH}" \
-H "X-Public-Key: ${PUBLIC_KEY}" \
-H "X-Timestamp: ${TIMESTAMP}" \
-H "X-Signature: ${SIGNATURE}" \
-H "Content-Type: application/json" \
-d "$BODY"
import crypto from 'crypto';
const publicKey = 'pk_live_abcdef123456';
const secretKey = 'sk_live_secret789xyz';
const timestamp = Math.floor(Date.now() / 1000);
const method = 'POST';
const path = '/v1/pm/markets/b2c3d4e5-f6a7-8901-bcde-f12345678901/burn';
const body = JSON.stringify({
quantity: 10,
currency: 'USD',
});
const bodyHash = crypto.createHash('sha256').update(body).digest('hex');
const payload = `${timestamp}.${method}.${path}.${bodyHash}`;
const signature = crypto
.createHmac('sha256', secretKey)
.update(payload)
.digest('base64');
const response = await fetch(`https://relay.bayse.markets${path}`, {
method,
headers: {
'X-Public-Key': publicKey,
'X-Timestamp': timestamp.toString(),
'X-Signature': signature,
'Content-Type': 'application/json',
},
body,
});
const result = await response.json();
import hmac, hashlib, base64, json, time, requests
public_key = 'pk_live_abcdef123456'
secret_key = 'sk_live_secret789xyz'
timestamp = int(time.time())
method = 'POST'
path = '/v1/pm/markets/b2c3d4e5-f6a7-8901-bcde-f12345678901/burn'
body = json.dumps({
'quantity': 10,
'currency': 'USD',
})
body_hash = hashlib.sha256(body.encode()).hexdigest()
payload = f'{timestamp}.{method}.{path}.{body_hash}'
signature = base64.b64encode(
hmac.new(secret_key.encode(), payload.encode(), hashlib.sha256).digest()
).decode()
resp = requests.post(
f'https://relay.bayse.markets{path}',
headers={
'X-Public-Key': public_key,
'X-Timestamp': str(timestamp),
'X-Signature': signature,
'Content-Type': 'application/json',
},
data=body,
)
result = resp.json()
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"fmt"
"strconv"
"strings"
"time"
)
timestamp := time.Now().Unix()
method := "POST"
urlPath := "/v1/pm/markets/b2c3d4e5-f6a7-8901-bcde-f12345678901/burn"
body := []byte(`{"quantity":10,"currency":"USD"}`)
bodySum := sha256.Sum256(body)
bodyHash := hex.EncodeToString(bodySum[:])
payload := fmt.Sprintf("%d.%s.%s.%s", timestamp, method, urlPath, bodyHash)
mac := hmac.New(sha256.New, []byte("sk_live_secret789xyz"))
mac.Write([]byte(payload))
signature := base64.StdEncoding.EncodeToString(mac.Sum(nil))
req, _ := http.NewRequest("POST", "https://relay.bayse.markets"+urlPath, strings.NewReader(string(body)))
req.Header.Set("X-Public-Key", "pk_live_abcdef123456")
req.Header.Set("X-Timestamp", strconv.FormatInt(timestamp, 10))
req.Header.Set("X-Signature", signature)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
Response
string
UUID of the burn operation.
string
UUID of the market.
number
Normalized share quantity burned.
number
Current price of outcome 1 (YES). Returned for convenience — burning does not change market prices.
number
Current price of outcome 2 (NO). Returned for convenience — burning does not change market prices.
number
Funds returned from the burn operation.
{
"operationId": "e5f6a7b8-c9d0-1234-efab-567890123456",
"marketId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"quantity": 10,
"outcome1Price": 0.65,
"outcome2Price": 0.35,
"proceeds": 10.00
}
⌘I