Start share split
curl --request POST \
--url https://api.worm.wtf/share-splits/ \
--header 'Content-Type: application/json' \
--data '
{
"market_condition_id": "<string>",
"amount": "<string>"
}
'import requests
url = "https://api.worm.wtf/share-splits/"
payload = {
"market_condition_id": "<string>",
"amount": "<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({market_condition_id: '<string>', amount: '<string>'})
};
fetch('https://api.worm.wtf/share-splits/', 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/share-splits/",
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([
'market_condition_id' => '<string>',
'amount' => '<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://api.worm.wtf/share-splits/"
payload := strings.NewReader("{\n \"market_condition_id\": \"<string>\",\n \"amount\": \"<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://api.worm.wtf/share-splits/")
.header("Content-Type", "application/json")
.body("{\n \"market_condition_id\": \"<string>\",\n \"amount\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.worm.wtf/share-splits/")
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 \"market_condition_id\": \"<string>\",\n \"amount\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"pubkey": "HwqEtgeDoWHLqyMQgjwj7BGWmCrZ46m6y5bALMfYcGYY",
"message": "Program call payload to split shares."
},
"meta": {},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": 4312,
"slug": "share_split_insufficient_usdc",
"message": "Not enough available USDC to split this amount.",
"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": 4305,
"slug": "share_split_in_progress",
"message": "A split on this market is already in progress.",
"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": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": 3042,
"slug": "gringotts_unavailable",
"message": "The signing service is temporarily unavailable. Please try again shortly.",
"details": []
}
}
Share Splits
Start share split
Create a share split draft. Must be signed and submitted.
POST
/
share-splits
/
Start share split
curl --request POST \
--url https://api.worm.wtf/share-splits/ \
--header 'Content-Type: application/json' \
--data '
{
"market_condition_id": "<string>",
"amount": "<string>"
}
'import requests
url = "https://api.worm.wtf/share-splits/"
payload = {
"market_condition_id": "<string>",
"amount": "<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({market_condition_id: '<string>', amount: '<string>'})
};
fetch('https://api.worm.wtf/share-splits/', 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/share-splits/",
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([
'market_condition_id' => '<string>',
'amount' => '<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://api.worm.wtf/share-splits/"
payload := strings.NewReader("{\n \"market_condition_id\": \"<string>\",\n \"amount\": \"<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://api.worm.wtf/share-splits/")
.header("Content-Type", "application/json")
.body("{\n \"market_condition_id\": \"<string>\",\n \"amount\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.worm.wtf/share-splits/")
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 \"market_condition_id\": \"<string>\",\n \"amount\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"pubkey": "HwqEtgeDoWHLqyMQgjwj7BGWmCrZ46m6y5bALMfYcGYY",
"message": "Program call payload to split shares."
},
"meta": {},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": 4312,
"slug": "share_split_insufficient_usdc",
"message": "Not enough available USDC to split this amount.",
"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": 4305,
"slug": "share_split_in_progress",
"message": "A split on this market is already in progress.",
"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": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": 3042,
"slug": "gringotts_unavailable",
"message": "The signing service is temporarily unavailable. Please try again shortly.",
"details": []
}
}
Convert USDC into a complete set of outcome shares: each
1 USDC becomes 1 YES share and 1 NO share.
Share splits are available on open order book markets that do not have margin trading enabled. Other markets return share_conversion_market_not_eligible.
Creating a draft locks the USDC for amount until the split finishes. Drafts expire quickly, so sign and submit promptly. An unsigned draft that expires moves to expired and releases the lock.
Body Parameters
string
required
Market condition id.
string
required
USDC to split. You receive this many YES shares and this many NO shares. Must be a positive multiple of the market’s lot size,
10^-amount_precision (see amount_precision on Get market by condition id). At most 6 decimal places.Sign the returned
message, then call Submit share split with the hex signature (see that page). Track the result with Get share split by pubkey.Response
On success the API returns201 Created with a Location header pointing to GET /share-splits/{pubkey}/.
object
Created share split draft payload.
object
Empty object on success for this endpoint.
object | null
null on success. Error object on failed requests.Errors
| Status | Slug | When |
|---|---|---|
400 | invalid_request_params | Validation failed, for example the market is not found (details names the field). |
400 | share_conversion_market_not_eligible | The market does not support split and merge. |
400 | share_conversion_invalid_amount | amount is not a positive multiple of the market’s lot size. |
400 | share_split_insufficient_usdc | Your available USDC (not locked by open orders or other conversions) is below amount. |
403 | custodial_user_trading_not_allowed | Custodial accounts cannot use split and merge. |
409 | share_conversion_market_not_open | The market is not open. |
409 | share_conversion_market_paused | The market is paused on chain. |
409 | share_split_in_progress | Another share split on this market is waiting to be signed or in process. Repeating a request for an unsigned draft with the same amount returns that draft instead of this error. |
503 | gringotts_unavailable | The signing service is temporarily unavailable. Retry shortly. |
{
"data": {
"pubkey": "HwqEtgeDoWHLqyMQgjwj7BGWmCrZ46m6y5bALMfYcGYY",
"message": "Program call payload to split shares."
},
"meta": {},
"error": null
}
{
"data": null,
"meta": null,
"error": {
"code": -11,
"slug": "invalid_request_params",
"message": "Validation Error",
"details": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": 4312,
"slug": "share_split_insufficient_usdc",
"message": "Not enough available USDC to split this amount.",
"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": 4305,
"slug": "share_split_in_progress",
"message": "A split on this market is already in progress.",
"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": []
}
}
{
"data": null,
"meta": null,
"error": {
"code": 3042,
"slug": "gringotts_unavailable",
"message": "The signing service is temporarily unavailable. Please try again shortly.",
"details": []
}
}