Submit agent trade intent
curl --request POST \
--url https://api-421614.alphagrid.capital/agents/{agentId}/trade-intents \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "NVDA",
"usdcAmount": "25000",
"exits": [
{
"triggerBps": 123,
"exitBps": 5000
}
],
"deadline": "1735689600",
"nonce": "0",
"signature": "0x",
"minTokenOut": "0",
"maxSlippageBps": 100
}
'import requests
url = "https://api-421614.alphagrid.capital/agents/{agentId}/trade-intents"
payload = {
"symbol": "NVDA",
"usdcAmount": "25000",
"exits": [
{
"triggerBps": 123,
"exitBps": 5000
}
],
"deadline": "1735689600",
"nonce": "0",
"signature": "0x",
"minTokenOut": "0",
"maxSlippageBps": 100
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
symbol: 'NVDA',
usdcAmount: '25000',
exits: [{triggerBps: 123, exitBps: 5000}],
deadline: '1735689600',
nonce: '0',
signature: '0x',
minTokenOut: '0',
maxSlippageBps: 100
})
};
fetch('https://api-421614.alphagrid.capital/agents/{agentId}/trade-intents', 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://api-421614.alphagrid.capital/agents/{agentId}/trade-intents",
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([
'symbol' => 'NVDA',
'usdcAmount' => '25000',
'exits' => [
[
'triggerBps' => 123,
'exitBps' => 5000
]
],
'deadline' => '1735689600',
'nonce' => '0',
'signature' => '0x',
'minTokenOut' => '0',
'maxSlippageBps' => 100
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api-421614.alphagrid.capital/agents/{agentId}/trade-intents"
payload := strings.NewReader("{\n \"symbol\": \"NVDA\",\n \"usdcAmount\": \"25000\",\n \"exits\": [\n {\n \"triggerBps\": 123,\n \"exitBps\": 5000\n }\n ],\n \"deadline\": \"1735689600\",\n \"nonce\": \"0\",\n \"signature\": \"0x\",\n \"minTokenOut\": \"0\",\n \"maxSlippageBps\": 100\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api-421614.alphagrid.capital/agents/{agentId}/trade-intents")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"NVDA\",\n \"usdcAmount\": \"25000\",\n \"exits\": [\n {\n \"triggerBps\": 123,\n \"exitBps\": 5000\n }\n ],\n \"deadline\": \"1735689600\",\n \"nonce\": \"0\",\n \"signature\": \"0x\",\n \"minTokenOut\": \"0\",\n \"maxSlippageBps\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-421614.alphagrid.capital/agents/{agentId}/trade-intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"symbol\": \"NVDA\",\n \"usdcAmount\": \"25000\",\n \"exits\": [\n {\n \"triggerBps\": 123,\n \"exitBps\": 5000\n }\n ],\n \"deadline\": \"1735689600\",\n \"nonce\": \"0\",\n \"signature\": \"0x\",\n \"minTokenOut\": \"0\",\n \"maxSlippageBps\": 100\n}"
response = http.request(request)
puts response.read_body{
"agentId": "<string>",
"positionId": "<string>",
"transactionHash": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Trading
Submit agent trade intent
Verifies an EIP-712 OpenPosition signature and relays TradeRouter.openPosition via the executor.
POST
/
agents
/
{agentId}
/
trade-intents
Submit agent trade intent
curl --request POST \
--url https://api-421614.alphagrid.capital/agents/{agentId}/trade-intents \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "NVDA",
"usdcAmount": "25000",
"exits": [
{
"triggerBps": 123,
"exitBps": 5000
}
],
"deadline": "1735689600",
"nonce": "0",
"signature": "0x",
"minTokenOut": "0",
"maxSlippageBps": 100
}
'import requests
url = "https://api-421614.alphagrid.capital/agents/{agentId}/trade-intents"
payload = {
"symbol": "NVDA",
"usdcAmount": "25000",
"exits": [
{
"triggerBps": 123,
"exitBps": 5000
}
],
"deadline": "1735689600",
"nonce": "0",
"signature": "0x",
"minTokenOut": "0",
"maxSlippageBps": 100
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
symbol: 'NVDA',
usdcAmount: '25000',
exits: [{triggerBps: 123, exitBps: 5000}],
deadline: '1735689600',
nonce: '0',
signature: '0x',
minTokenOut: '0',
maxSlippageBps: 100
})
};
fetch('https://api-421614.alphagrid.capital/agents/{agentId}/trade-intents', 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://api-421614.alphagrid.capital/agents/{agentId}/trade-intents",
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([
'symbol' => 'NVDA',
'usdcAmount' => '25000',
'exits' => [
[
'triggerBps' => 123,
'exitBps' => 5000
]
],
'deadline' => '1735689600',
'nonce' => '0',
'signature' => '0x',
'minTokenOut' => '0',
'maxSlippageBps' => 100
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api-421614.alphagrid.capital/agents/{agentId}/trade-intents"
payload := strings.NewReader("{\n \"symbol\": \"NVDA\",\n \"usdcAmount\": \"25000\",\n \"exits\": [\n {\n \"triggerBps\": 123,\n \"exitBps\": 5000\n }\n ],\n \"deadline\": \"1735689600\",\n \"nonce\": \"0\",\n \"signature\": \"0x\",\n \"minTokenOut\": \"0\",\n \"maxSlippageBps\": 100\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api-421614.alphagrid.capital/agents/{agentId}/trade-intents")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"NVDA\",\n \"usdcAmount\": \"25000\",\n \"exits\": [\n {\n \"triggerBps\": 123,\n \"exitBps\": 5000\n }\n ],\n \"deadline\": \"1735689600\",\n \"nonce\": \"0\",\n \"signature\": \"0x\",\n \"minTokenOut\": \"0\",\n \"maxSlippageBps\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-421614.alphagrid.capital/agents/{agentId}/trade-intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"symbol\": \"NVDA\",\n \"usdcAmount\": \"25000\",\n \"exits\": [\n {\n \"triggerBps\": 123,\n \"exitBps\": 5000\n }\n ],\n \"deadline\": \"1735689600\",\n \"nonce\": \"0\",\n \"signature\": \"0x\",\n \"minTokenOut\": \"0\",\n \"maxSlippageBps\": 100\n}"
response = http.request(request)
puts response.read_body{
"agentId": "<string>",
"positionId": "<string>",
"transactionHash": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Path Parameters
Pattern:
^[1-9]\d*$Example:
"1"
Body
application/json
Minimum string length:
1Example:
"NVDA"
Human USDC notional
Pattern:
^\d+(\.\d+)?$Example:
"25000"
Required array length:
1 - 5 elementsShow child attributes
Show child attributes
Unix timestamp for EIP-712 OpenPosition deadline
Pattern:
^\d+$Example:
"1735689600"
Pattern:
^\d+$Example:
"0"
Pattern:
^0x[a-fA-F0-9]+$Example:
"0x"
Pattern:
^\d+$Example:
"0"
Required range:
0 <= x <= 10000⌘I