SDK
import { PredictionMarketsClient } from '@solana-tracker/data-api';
const client = new PredictionMarketsClient({ apiKey: 'YOUR_API_KEY' });
const data = await client.getMarketQuote('MARKET_TICKER');curl --request GET \
--url https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote \
--header 'x-api-key: <api-key>'import requests
url = "https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote', 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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"estimated": true,
"source": "<string>",
"stale": true,
"cost": 123,
"exchange": "polymarket",
"filledSize": 123,
"fullyFilled": true,
"levelsConsumed": 1,
"marketId": "<string>",
"requestedSize": 123,
"side": "<string>",
"sizeUnit": "<string>",
"timestamp": "<string>",
"unfilledSize": 123,
"indexedAt": "<string>",
"sourceUpdatedAt": "<string>",
"unavailableReason": "<string>",
"avgPrice": 123,
"bestAsk": 123,
"bestBid": 123,
"displayPrice": 123,
"midpoint": 123,
"tokenId": "<string>",
"worstPrice": 123
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}Markets
预测市场 VWAP 报价 API
按 ticker 或 condition ID 遍历市场的实时订单簿,按投注金额估算成交结果。买入遍历卖单,卖出遍历买单。
GET
/
v1
/
markets
/
{ticker}
/
quote
SDK
import { PredictionMarketsClient } from '@solana-tracker/data-api';
const client = new PredictionMarketsClient({ apiKey: 'YOUR_API_KEY' });
const data = await client.getMarketQuote('MARKET_TICKER');curl --request GET \
--url https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote \
--header 'x-api-key: <api-key>'import requests
url = "https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote', 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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://prediction-market-api.solanatracker.io/v1/markets/{ticker}/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"estimated": true,
"source": "<string>",
"stale": true,
"cost": 123,
"exchange": "polymarket",
"filledSize": 123,
"fullyFilled": true,
"levelsConsumed": 1,
"marketId": "<string>",
"requestedSize": 123,
"side": "<string>",
"sizeUnit": "<string>",
"timestamp": "<string>",
"unfilledSize": 123,
"indexedAt": "<string>",
"sourceUpdatedAt": "<string>",
"unavailableReason": "<string>",
"avgPrice": 123,
"bestAsk": 123,
"bestBid": 123,
"displayPrice": 123,
"midpoint": 123,
"tokenId": "<string>",
"worstPrice": 123
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}{
"code": 1,
"error": "<string>",
"errorCode": "<string>"
}按投注金额遍历实时订单簿。买入遍历卖单,卖出遍历买单。可用于 TradePanel 的成交估算。盘口顶部的概率仍在
/price 和 WS …:prices 中提供。
SDK Example
import { PredictionMarketsClient } from '@solana-tracker/data-api';
const client = new PredictionMarketsClient({ apiKey: 'YOUR_API_KEY' });
const data = await client.getMarketQuote('MARKET_TICKER');
查询参数
响应
Size-aware quote
Size-aware fill quote from walking the live orderbook (VWAP).
此页面对您有帮助吗?