curl --request POST \
--url https://www.vibekast.xyz/api/v2/orders \
--header 'Content-Type: application/json' \
--data '
{
"budget": 123,
"quantiles": [
123
],
"probs": [
123
],
"wallet": "<string>",
"slippageBps": 250
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
budget: 123,
quantiles: [123],
probs: [123],
wallet: '<string>',
slippageBps: 250
})
};
fetch('https://www.vibekast.xyz/api/v2/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.vibekast.xyz/api/v2/orders"
payload = {
"budget": 123,
"quantiles": [123],
"probs": [123],
"wallet": "<string>",
"slippageBps": 250
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"chainId": 84532,
"market": "<string>",
"quote": {
"cost": "<string>",
"fee": "<string>",
"total": "<string>"
},
"maxCost": "<string>",
"maxCostWad": "<string>",
"shares": [
"<string>"
],
"sharesWad": [
"<string>"
],
"activeRanges": 0,
"transactions": [
{
"to": "<string>",
"data": "<string>",
"value": "0",
"description": "<string>"
}
],
"wallet": {
"address": "<string>",
"balance": "<string>",
"allowance": "<string>",
"needsApproval": true,
"enoughBalance": true
},
"note": "<string>"
}{
"code": "INVALID_JSON",
"message": "<string>"
}{
"code": "INVALID_JSON",
"message": "<string>"
}{
"code": "INVALID_JSON",
"message": "<string>"
}{
"code": "INVALID_JSON",
"message": "<string>"
}{
"code": "INVALID_JSON",
"message": "<string>"
}Turn a forecast into unsigned approve and buy transactions
Give your forecast as 7 quantiles or one weight per range, and a budget of 1-10000 tUSDC. The order buys more where your forecast is above the market’s price.
curl --request POST \
--url https://www.vibekast.xyz/api/v2/orders \
--header 'Content-Type: application/json' \
--data '
{
"budget": 123,
"quantiles": [
123
],
"probs": [
123
],
"wallet": "<string>",
"slippageBps": 250
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
budget: 123,
quantiles: [123],
probs: [123],
wallet: '<string>',
slippageBps: 250
})
};
fetch('https://www.vibekast.xyz/api/v2/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.vibekast.xyz/api/v2/orders"
payload = {
"budget": 123,
"quantiles": [123],
"probs": [123],
"wallet": "<string>",
"slippageBps": 250
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"chainId": 84532,
"market": "<string>",
"quote": {
"cost": "<string>",
"fee": "<string>",
"total": "<string>"
},
"maxCost": "<string>",
"maxCostWad": "<string>",
"shares": [
"<string>"
],
"sharesWad": [
"<string>"
],
"activeRanges": 0,
"transactions": [
{
"to": "<string>",
"data": "<string>",
"value": "0",
"description": "<string>"
}
],
"wallet": {
"address": "<string>",
"balance": "<string>",
"allowance": "<string>",
"needsApproval": true,
"enoughBalance": true
},
"note": "<string>"
}{
"code": "INVALID_JSON",
"message": "<string>"
}{
"code": "INVALID_JSON",
"message": "<string>"
}{
"code": "INVALID_JSON",
"message": "<string>"
}{
"code": "INVALID_JSON",
"message": "<string>"
}{
"code": "INVALID_JSON",
"message": "<string>"
}Body
Give exactly one of quantiles or probs. An empty array or null counts as not given.
tUSDC to spend, fee included, 1 to 10000.
Your forecast as 7 BTC prices in USD at the 5th, 10th, 25th, 50th, 75th, 90th and 95th percentiles, e.g. [76000, 77500, 79500, 81000, 82500, 84500, 86000].
A number, or the same value as a decimal string.
Alternative to quantiles: one non-negative weight per price range, in index order. Normalized for you.
A number, or the same value as a decimal string.
Your wallet. Lets the API check your balance and skip the approval if it's already granted.
^0x[0-9a-fA-F]{40}$Price-move allowance in basis points, default 100.
0 <= x <= 500Response
Transactions to sign and send in order.
0x-prefixed 20-byte address.
^0x[0-9a-fA-F]{40}$Quoted on-chain just now, in tUSDC.
Show child attributes
Show child attributes
The most the buy can cost, slippage included, in tUSDC.
^-?\d+(\.\d+)?$Integer in 18-decimal base units, as a string. 1 tUSDC = 1000000000000000000.
^\d+$Shares bought per price range, in index order.
Exact decimal number as a string, e.g. "0.0279" or "77000". Converted directly from the 18-decimal on-chain integer, never through a float.
^-?\d+(\.\d+)?$Integer in 18-decimal base units, as a string. 1 tUSDC = 1000000000000000000.
^\d+$-9007199254740991 <= x <= 9007199254740991Sign and send in order: approve (when needed), then buy.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?