Submit a signed RFQ trade
curl --request POST \
--url https://external-rfq-partner.polymarket.com/v1/rfq-trades \
--header 'Content-Type: application/json' \
--header 'RFQ-Key-Id: <api-key>' \
--header 'RFQ-Signature: <api-key>' \
--header 'RFQ-Timestamp: <api-key>' \
--data '
{
"orders": [
{
"salt": "<string>",
"maker": "0x4444444444444444444444444444444444444444",
"signer": "0x4444444444444444444444444444444444444444",
"tokenId": "<string>",
"makerAmount": "65000000",
"takerAmount": "65000000",
"signatureType": 123,
"timestamp": "<string>",
"metadata": "<string>",
"builder": "<string>",
"signature": "<string>"
}
],
"idempotencyKey": "<string>",
"marketId": "<string>",
"marketSource": "gamma",
"legs": [
{
"marketId": "<string>"
}
],
"combination": "and",
"priceTolerance": "<string>",
"takerFeeAmount": "0",
"makerFeeAmount": "0"
}
'import requests
url = "https://external-rfq-partner.polymarket.com/v1/rfq-trades"
payload = {
"orders": [
{
"salt": "<string>",
"maker": "0x4444444444444444444444444444444444444444",
"signer": "0x4444444444444444444444444444444444444444",
"tokenId": "<string>",
"makerAmount": "65000000",
"takerAmount": "65000000",
"signatureType": 123,
"timestamp": "<string>",
"metadata": "<string>",
"builder": "<string>",
"signature": "<string>"
}
],
"idempotencyKey": "<string>",
"marketId": "<string>",
"marketSource": "gamma",
"legs": [{ "marketId": "<string>" }],
"combination": "and",
"priceTolerance": "<string>",
"takerFeeAmount": "0",
"makerFeeAmount": "0"
}
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({
orders: [
{
salt: '<string>',
maker: '0x4444444444444444444444444444444444444444',
signer: '0x4444444444444444444444444444444444444444',
tokenId: '<string>',
makerAmount: '65000000',
takerAmount: '65000000',
signatureType: 123,
timestamp: '<string>',
metadata: '<string>',
builder: '<string>',
signature: '<string>'
}
],
idempotencyKey: '<string>',
marketId: '<string>',
marketSource: 'gamma',
legs: [{marketId: '<string>'}],
combination: 'and',
priceTolerance: '<string>',
takerFeeAmount: '0',
makerFeeAmount: '0'
})
};
fetch('https://external-rfq-partner.polymarket.com/v1/rfq-trades', 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",
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([
'orders' => [
[
'salt' => '<string>',
'maker' => '0x4444444444444444444444444444444444444444',
'signer' => '0x4444444444444444444444444444444444444444',
'tokenId' => '<string>',
'makerAmount' => '65000000',
'takerAmount' => '65000000',
'signatureType' => 123,
'timestamp' => '<string>',
'metadata' => '<string>',
'builder' => '<string>',
'signature' => '<string>'
]
],
'idempotencyKey' => '<string>',
'marketId' => '<string>',
'marketSource' => 'gamma',
'legs' => [
[
'marketId' => '<string>'
]
],
'combination' => 'and',
'priceTolerance' => '<string>',
'takerFeeAmount' => '0',
'makerFeeAmount' => '0'
]),
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"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"salt\": \"<string>\",\n \"maker\": \"0x4444444444444444444444444444444444444444\",\n \"signer\": \"0x4444444444444444444444444444444444444444\",\n \"tokenId\": \"<string>\",\n \"makerAmount\": \"65000000\",\n \"takerAmount\": \"65000000\",\n \"signatureType\": 123,\n \"timestamp\": \"<string>\",\n \"metadata\": \"<string>\",\n \"builder\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"idempotencyKey\": \"<string>\",\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\",\n \"takerFeeAmount\": \"0\",\n \"makerFeeAmount\": \"0\"\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")
.header("RFQ-Key-Id", "<api-key>")
.header("RFQ-Timestamp", "<api-key>")
.header("RFQ-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"salt\": \"<string>\",\n \"maker\": \"0x4444444444444444444444444444444444444444\",\n \"signer\": \"0x4444444444444444444444444444444444444444\",\n \"tokenId\": \"<string>\",\n \"makerAmount\": \"65000000\",\n \"takerAmount\": \"65000000\",\n \"signatureType\": 123,\n \"timestamp\": \"<string>\",\n \"metadata\": \"<string>\",\n \"builder\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"idempotencyKey\": \"<string>\",\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\",\n \"takerFeeAmount\": \"0\",\n \"makerFeeAmount\": \"0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-rfq-partner.polymarket.com/v1/rfq-trades")
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 \"orders\": [\n {\n \"salt\": \"<string>\",\n \"maker\": \"0x4444444444444444444444444444444444444444\",\n \"signer\": \"0x4444444444444444444444444444444444444444\",\n \"tokenId\": \"<string>\",\n \"makerAmount\": \"65000000\",\n \"takerAmount\": \"65000000\",\n \"signatureType\": 123,\n \"timestamp\": \"<string>\",\n \"metadata\": \"<string>\",\n \"builder\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"idempotencyKey\": \"<string>\",\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\",\n \"takerFeeAmount\": \"0\",\n \"makerFeeAmount\": \"0\"\n}"
response = http.request(request)
puts response.read_body{
"tradeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"createdAt": "2023-11-07T05:31:56Z",
"fees": {},
"transactionHash": "<string>",
"combo": {
"conditionId": "<string>",
"tokenIdYes": "<string>",
"tokenIdNo": "<string>",
"legs": [
{
"marketId": "<string>",
"outcome": "yes"
}
]
}
}{
"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 交易
提交双方已签名的订单。交易以 PENDING 状态被接受,并异步执行。
POST
/
v1
/
rfq-trades
Submit a signed RFQ trade
curl --request POST \
--url https://external-rfq-partner.polymarket.com/v1/rfq-trades \
--header 'Content-Type: application/json' \
--header 'RFQ-Key-Id: <api-key>' \
--header 'RFQ-Signature: <api-key>' \
--header 'RFQ-Timestamp: <api-key>' \
--data '
{
"orders": [
{
"salt": "<string>",
"maker": "0x4444444444444444444444444444444444444444",
"signer": "0x4444444444444444444444444444444444444444",
"tokenId": "<string>",
"makerAmount": "65000000",
"takerAmount": "65000000",
"signatureType": 123,
"timestamp": "<string>",
"metadata": "<string>",
"builder": "<string>",
"signature": "<string>"
}
],
"idempotencyKey": "<string>",
"marketId": "<string>",
"marketSource": "gamma",
"legs": [
{
"marketId": "<string>"
}
],
"combination": "and",
"priceTolerance": "<string>",
"takerFeeAmount": "0",
"makerFeeAmount": "0"
}
'import requests
url = "https://external-rfq-partner.polymarket.com/v1/rfq-trades"
payload = {
"orders": [
{
"salt": "<string>",
"maker": "0x4444444444444444444444444444444444444444",
"signer": "0x4444444444444444444444444444444444444444",
"tokenId": "<string>",
"makerAmount": "65000000",
"takerAmount": "65000000",
"signatureType": 123,
"timestamp": "<string>",
"metadata": "<string>",
"builder": "<string>",
"signature": "<string>"
}
],
"idempotencyKey": "<string>",
"marketId": "<string>",
"marketSource": "gamma",
"legs": [{ "marketId": "<string>" }],
"combination": "and",
"priceTolerance": "<string>",
"takerFeeAmount": "0",
"makerFeeAmount": "0"
}
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({
orders: [
{
salt: '<string>',
maker: '0x4444444444444444444444444444444444444444',
signer: '0x4444444444444444444444444444444444444444',
tokenId: '<string>',
makerAmount: '65000000',
takerAmount: '65000000',
signatureType: 123,
timestamp: '<string>',
metadata: '<string>',
builder: '<string>',
signature: '<string>'
}
],
idempotencyKey: '<string>',
marketId: '<string>',
marketSource: 'gamma',
legs: [{marketId: '<string>'}],
combination: 'and',
priceTolerance: '<string>',
takerFeeAmount: '0',
makerFeeAmount: '0'
})
};
fetch('https://external-rfq-partner.polymarket.com/v1/rfq-trades', 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",
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([
'orders' => [
[
'salt' => '<string>',
'maker' => '0x4444444444444444444444444444444444444444',
'signer' => '0x4444444444444444444444444444444444444444',
'tokenId' => '<string>',
'makerAmount' => '65000000',
'takerAmount' => '65000000',
'signatureType' => 123,
'timestamp' => '<string>',
'metadata' => '<string>',
'builder' => '<string>',
'signature' => '<string>'
]
],
'idempotencyKey' => '<string>',
'marketId' => '<string>',
'marketSource' => 'gamma',
'legs' => [
[
'marketId' => '<string>'
]
],
'combination' => 'and',
'priceTolerance' => '<string>',
'takerFeeAmount' => '0',
'makerFeeAmount' => '0'
]),
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"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"salt\": \"<string>\",\n \"maker\": \"0x4444444444444444444444444444444444444444\",\n \"signer\": \"0x4444444444444444444444444444444444444444\",\n \"tokenId\": \"<string>\",\n \"makerAmount\": \"65000000\",\n \"takerAmount\": \"65000000\",\n \"signatureType\": 123,\n \"timestamp\": \"<string>\",\n \"metadata\": \"<string>\",\n \"builder\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"idempotencyKey\": \"<string>\",\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\",\n \"takerFeeAmount\": \"0\",\n \"makerFeeAmount\": \"0\"\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")
.header("RFQ-Key-Id", "<api-key>")
.header("RFQ-Timestamp", "<api-key>")
.header("RFQ-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"salt\": \"<string>\",\n \"maker\": \"0x4444444444444444444444444444444444444444\",\n \"signer\": \"0x4444444444444444444444444444444444444444\",\n \"tokenId\": \"<string>\",\n \"makerAmount\": \"65000000\",\n \"takerAmount\": \"65000000\",\n \"signatureType\": 123,\n \"timestamp\": \"<string>\",\n \"metadata\": \"<string>\",\n \"builder\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"idempotencyKey\": \"<string>\",\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\",\n \"takerFeeAmount\": \"0\",\n \"makerFeeAmount\": \"0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-rfq-partner.polymarket.com/v1/rfq-trades")
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 \"orders\": [\n {\n \"salt\": \"<string>\",\n \"maker\": \"0x4444444444444444444444444444444444444444\",\n \"signer\": \"0x4444444444444444444444444444444444444444\",\n \"tokenId\": \"<string>\",\n \"makerAmount\": \"65000000\",\n \"takerAmount\": \"65000000\",\n \"signatureType\": 123,\n \"timestamp\": \"<string>\",\n \"metadata\": \"<string>\",\n \"builder\": \"<string>\",\n \"signature\": \"<string>\"\n }\n ],\n \"idempotencyKey\": \"<string>\",\n \"marketId\": \"<string>\",\n \"marketSource\": \"gamma\",\n \"legs\": [\n {\n \"marketId\": \"<string>\"\n }\n ],\n \"combination\": \"and\",\n \"priceTolerance\": \"<string>\",\n \"takerFeeAmount\": \"0\",\n \"makerFeeAmount\": \"0\"\n}"
response = http.request(request)
puts response.read_body{
"tradeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "PENDING",
"createdAt": "2023-11-07T05:31:56Z",
"fees": {},
"transactionHash": "<string>",
"combo": {
"conditionId": "<string>",
"tokenIdYes": "<string>",
"tokenIdNo": "<string>",
"legs": [
{
"marketId": "<string>",
"outcome": "yes"
}
]
}
}{
"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
响应
The accepted trade, or the original one on an idempotent replay.
此页面对您有帮助吗?