get AMM pool trade transactions
Rate limit: every seconds
API Overview
HTTP method
GET
Path
/api/v3/amm/trades
Summary
get AMM pool trade transactions
API description
HTTP Header
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| X-API-KEY | string | Y | ApiKey | "HlkcGxbqBeaF76j4rvPaOasyfPwnkQ 6B6DQ6THZWbvrAGxzEdulXQvOKLrRW ZLnN" |
Request parameters
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| ammPoolAddress | string | Y | The address of the pool on which the swap was submitted. | "0xbbbbca6a901c926f24 0b89eacb641d8aec7aea fd" |
| limit | integer | N | Used to limit the number of returned records. Useful in implementing pagination. | 50 |
| offset | integer | N | Used to apply an offset when looking for valid records. Useful in implementing | 0 |
Request example
HTTP
CURL
GET http://aa90cd58e38014a1b864ddc488129b7a-624979106.us-east-2.elb.amazonaws.com/api/v3/amm/trades?ammPoolAddress=0xbbbbca6a901c926f240b89eacb641d8aec7aeafd&limit=50&offset=0 HTTP/1.1
Host: aa90cd58e38014a1b864ddc488129b7a-624979106.us-east-2.elb.amazonaws.com
Connection: keep-alive
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: zh,en;q=0.9
X-API-KEY: sra1aavfacurl -H "X-API-KEY:sra1aavfa" http://aa90cd58e38014a1b864ddc488129b7a-624979106.us-east-2.elb.amazonaws.com/api/v3/amm/trades\?ammPoolAddress\=0xbbbbca6a901c926f240b89eacb641d8aec7aeafd\&limit\=50\&offset\=0Response fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| totalNum | integer | Y | Number of trades | 12345 |
| trades | List[AmmTradeDataV3] | Y | AMM trade list | / |
Response example
{
"totalNum" : 12345,
"trades" : [
{
"accountId" : 12345,
"orderHash" : "0xf7c932351186c3a9053f313eefa16209c018f7f1dba8aa8ca7100400f7c31085",
"market" : "AMM-DAI-ETH",
"side" : "BUY",
"size" : "100000000",
"price" : 0.03,
"feeAmount" : "100000000",
"createdAt" : 1608189538074
}
]
}
Status code
| Value | Description |
|---|---|
| 100000 | Unknown error |
| 107001 | User ID cannot be empty |
| 104001 | Empty ApiKey |
| 104002 | Invalid ApiKey |
| 104003 | Invalid Account ID |
Model
AmmTradeDataV3
AMM trade info data
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| accountId | integer | Y | trader's accountId | 12345 |
| orderHash | string | Y | AMM trade's order hash | "0xf7c932351186c3a905 3f313eefa16209c018f7 f1dba8aa8ca7100400f7 c31085" |
| market | string | Y | The trade market | "AMM-DAI-ETH" |
| side | string | Y | The trade direction, buy or sell Allowable : ['BUY', 'SELL'] |
"BUY" |
| size | string | Y | The trade volume | "100000000" |
| price | number | Y | The trade price | 0.03 |
| feeAmount | string | Y | The trade fee | "100000000" |
| createdAt | integer | Y | The trade's creation time | 1608189538074 |