Pre-flight proposed terms
curl --request POST \
--url https://external-rfq-partner.polymarket.com/v1/rfq-trades/validate \
--header 'Content-Type: application/json' \
--header 'RFQ-Key-Id: <api-key>' \
--header 'RFQ-Signature: <api-key>' \
--header 'RFQ-Timestamp: <api-key>' \
--data '
{
"price": "0.65",
"shares": "65000000",
"parties": {},
"marketId": "<string>",
"marketSource": "gamma",
"legs": [
{
"marketId": "<string>"
}
],
"combination": "and",
"priceTolerance": "<string>"
}
'import requests
url = "https://external-rfq-partner.polymarket.com/v1/rfq-trades/validate"
payload = {
"price": "0.65",
"shares": "65000000",
"parties": {},
"marketId": "<string>",
"marketSource": "gamma",
"legs": [{ "marketId": "<string>" }],
"combination": "and",
"priceTolerance": "<string>"
}
headers = {
"RFQ-Key-Id": "<api-key>",
"RFQ-Timestamp": "<api-key>",
"RFQ-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'RFQ-Key-Id': '<api-key>',
'RFQ-Timestamp': '<api-key>',
'RFQ-Signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
price: '0.65',
shares: '65000000',
parties: {},
marketId: '<string>',
marketSource: 'gamma',
legs: [{marketId: '<string>'}],
combination: 'and',
priceTolerance: '<string>'
})
};
fetch('https://external-rfq-partner.polymarket.com/v1/rfq-trades/validate', 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://external-rfq-partner.polymarket.com/v1/rfq-trades/validate",
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([
'price' => '0.65',
'shares' => '65000000',
'parties' => [
],
'marketId' => '<string>',
'marketSource' => 'gamma',
'legs' => [
[
'marketId' => '<string>'
]
],
'combination' => 'and',
'priceTolerance' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"RFQ-Key-Id: <api-key>",
"RFQ-Signature: <api-key>",
"RFQ-Timestamp: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://external-rfq-partner.polymarket.com/v1/rfq-trades/validate"
payload := strings.NewReader("{\n \"price\": \"0.65\",\n \"shares\": \"65000000\",\n \"parties\": {},\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("RFQ-Key-Id", "<api-key>")
req.Header.Add("RFQ-Timestamp", "<api-key>")
req.Header.Add("RFQ-Signature", "<api-key>")
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://external-rfq-partner.polymarket.com/v1/rfq-trades/validate")
.header("RFQ-Key-Id", "<api-key>")
.header("RFQ-Timestamp", "<api-key>")
.header("RFQ-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"price\": \"0.65\",\n \"shares\": \"65000000\",\n \"parties\": {},\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-rfq-partner.polymarket.com/v1/rfq-trades/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["RFQ-Key-Id"] = '<api-key>'
request["RFQ-Timestamp"] = '<api-key>'
request["RFQ-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": \"0.65\",\n \"shares\": \"65000000\",\n \"parties\": {},\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"checks": {
"market": {
"status": "pass",
"reason": "unknown_account",
"detail": "<string>"
},
"price": {
"status": "pass",
"reason": "unknown_account",
"detail": "<string>",
"band": {
"mark": "<string>",
"lower": "<string>",
"upper": "<string>"
}
},
"parties": {},
"guardrails": [
{
"id": "taker_notional",
"status": "pass",
"reason": "unknown_account",
"detail": "<string>",
"party": "<string>"
}
]
},
"checkedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}验证 RFQ 交易
运行提交这些条款时会执行的所有检查,不存储任何内容。
POST
/
v1
/
rfq-trades
/
validate
Pre-flight proposed terms
curl --request POST \
--url https://external-rfq-partner.polymarket.com/v1/rfq-trades/validate \
--header 'Content-Type: application/json' \
--header 'RFQ-Key-Id: <api-key>' \
--header 'RFQ-Signature: <api-key>' \
--header 'RFQ-Timestamp: <api-key>' \
--data '
{
"price": "0.65",
"shares": "65000000",
"parties": {},
"marketId": "<string>",
"marketSource": "gamma",
"legs": [
{
"marketId": "<string>"
}
],
"combination": "and",
"priceTolerance": "<string>"
}
'import requests
url = "https://external-rfq-partner.polymarket.com/v1/rfq-trades/validate"
payload = {
"price": "0.65",
"shares": "65000000",
"parties": {},
"marketId": "<string>",
"marketSource": "gamma",
"legs": [{ "marketId": "<string>" }],
"combination": "and",
"priceTolerance": "<string>"
}
headers = {
"RFQ-Key-Id": "<api-key>",
"RFQ-Timestamp": "<api-key>",
"RFQ-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'RFQ-Key-Id': '<api-key>',
'RFQ-Timestamp': '<api-key>',
'RFQ-Signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
price: '0.65',
shares: '65000000',
parties: {},
marketId: '<string>',
marketSource: 'gamma',
legs: [{marketId: '<string>'}],
combination: 'and',
priceTolerance: '<string>'
})
};
fetch('https://external-rfq-partner.polymarket.com/v1/rfq-trades/validate', 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://external-rfq-partner.polymarket.com/v1/rfq-trades/validate",
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([
'price' => '0.65',
'shares' => '65000000',
'parties' => [
],
'marketId' => '<string>',
'marketSource' => 'gamma',
'legs' => [
[
'marketId' => '<string>'
]
],
'combination' => 'and',
'priceTolerance' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"RFQ-Key-Id: <api-key>",
"RFQ-Signature: <api-key>",
"RFQ-Timestamp: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://external-rfq-partner.polymarket.com/v1/rfq-trades/validate"
payload := strings.NewReader("{\n \"price\": \"0.65\",\n \"shares\": \"65000000\",\n \"parties\": {},\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("RFQ-Key-Id", "<api-key>")
req.Header.Add("RFQ-Timestamp", "<api-key>")
req.Header.Add("RFQ-Signature", "<api-key>")
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://external-rfq-partner.polymarket.com/v1/rfq-trades/validate")
.header("RFQ-Key-Id", "<api-key>")
.header("RFQ-Timestamp", "<api-key>")
.header("RFQ-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"price\": \"0.65\",\n \"shares\": \"65000000\",\n \"parties\": {},\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-rfq-partner.polymarket.com/v1/rfq-trades/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["RFQ-Key-Id"] = '<api-key>'
request["RFQ-Timestamp"] = '<api-key>'
request["RFQ-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": \"0.65\",\n \"shares\": \"65000000\",\n \"parties\": {},\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"checks": {
"market": {
"status": "pass",
"reason": "unknown_account",
"detail": "<string>"
},
"price": {
"status": "pass",
"reason": "unknown_account",
"detail": "<string>",
"band": {
"mark": "<string>",
"lower": "<string>",
"upper": "<string>"
}
},
"parties": {},
"guardrails": [
{
"id": "taker_notional",
"status": "pass",
"reason": "unknown_account",
"detail": "<string>",
"party": "<string>"
}
]
},
"checkedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}{
"error": {
"code": "validation_failed",
"message": "stale_order (taker): order timestamp is 12m0s old (max 10m0s)",
"retryable": false,
"details": {
"reason": "stale_order",
"party": "taker"
}
}
}完整的交易流程请参阅 RFQ 交易合作伙伴 API 指南。
授权
请求体
application/json
此页面对您有帮助吗?