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
API de cotización VWAP de mercados de predicción
Estima el fill de un tamaño de stake recorriendo el libro de órdenes en vivo, por ticker o condition ID. Las compras recorren asks y las ventas, bids.
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>"
}Recorre el libro de órdenes en vivo para un tamaño de stake. La compra recorre asks; la venta recorre bids. Úsalo para estimar fills en TradePanel. La probabilidad del mejor nivel del libro sigue en
/price y en el 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');
Parámetros de consulta
Respuesta
Size-aware quote
Size-aware fill quote from walking the live orderbook (VWAP).
¿Esta página le ayudó?