Agent trade activity
curl --request GET \
--url https://api-421614.alphagrid.capital/agents/{agentId}/tradesimport requests
url = "https://api-421614.alphagrid.capital/agents/{agentId}/trades"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api-421614.alphagrid.capital/agents/{agentId}/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://api-421614.alphagrid.capital/agents/{agentId}/trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api-421614.alphagrid.capital/agents/{agentId}/trades"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-421614.alphagrid.capital/agents/{agentId}/trades")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-421614.alphagrid.capital/agents/{agentId}/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"agentId": "<string>",
"source": "on-chain-events",
"scannedFromBlock": "<string>",
"trades": [
{
"type": "PositionOpened",
"positionId": "<string>",
"blockNumber": "<string>",
"transactionHash": "<string>",
"timestamp": "<string>",
"logIndex": 123,
"source": "TradeRouter",
"vault": "<string>",
"token": "<string>",
"symbol": "<string>",
"usdcIn": "<string>",
"usdcOut": "<string>",
"tokensAdded": "<string>",
"exitBps": 123,
"ruleIndex": 123,
"nextRuleIndex": 123,
"keeper": "<string>",
"keeperBounty": "<string>",
"operator": "<string>",
"realizedPnlUsdc": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Trading
Agent trade activity
On-chain v1 activity feed from TradeRouter and PositionManager event logs (newest first). Scans backwards from latest; lower bound is chain deploy block or ?fromBlock=.
GET
/
agents
/
{agentId}
/
trades
Agent trade activity
curl --request GET \
--url https://api-421614.alphagrid.capital/agents/{agentId}/tradesimport requests
url = "https://api-421614.alphagrid.capital/agents/{agentId}/trades"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api-421614.alphagrid.capital/agents/{agentId}/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://api-421614.alphagrid.capital/agents/{agentId}/trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api-421614.alphagrid.capital/agents/{agentId}/trades"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-421614.alphagrid.capital/agents/{agentId}/trades")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-421614.alphagrid.capital/agents/{agentId}/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"agentId": "<string>",
"source": "on-chain-events",
"scannedFromBlock": "<string>",
"trades": [
{
"type": "PositionOpened",
"positionId": "<string>",
"blockNumber": "<string>",
"transactionHash": "<string>",
"timestamp": "<string>",
"logIndex": 123,
"source": "TradeRouter",
"vault": "<string>",
"token": "<string>",
"symbol": "<string>",
"usdcIn": "<string>",
"usdcOut": "<string>",
"tokensAdded": "<string>",
"exitBps": 123,
"ruleIndex": 123,
"nextRuleIndex": 123,
"keeper": "<string>",
"keeperBounty": "<string>",
"operator": "<string>",
"realizedPnlUsdc": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Path Parameters
Pattern:
^[1-9]\d*$Example:
"1"
Query Parameters
Required range:
1 <= x <= 100Optional lower block bound for log scan (defaults to chain trading deploy block)
Pattern:
^\d+$Example:
"276471279"
Response
Agent trade activity