v1.1 / Dec 2023
The DEX Screener Adapter is a set of HTTP endpoints that allows DEX Screener to track historical and real-time data for any Partner Decentralized Exchange. Adapters are responsible for supplying accurate and up-to-date data, whereas DEX Screener handles all data ingestion, processing and serving.
An in-depth explanation of the schemas expected for each endpoint is described on the Schemas
section below
Numbers for amounts and price can be both number
and string
. Strings are more suitable when dealing with extremely small or extremely large numbers that can't be accurately serialized into JSON numbers.
Indexing will halt if schemas are invalid or contain unexpected values (i.e.: swapEvent.priceNative=0
or pair.name=""
)
Request: GET /latest-block
Response Schema:
interface LatestBlockResponse {
block: Block;
}
Example Response:
{
"block": {
"blockNumber": 100,
"blockTimestamp": 1698126147
}
}
Notes:
/latest-block
endpoint should be in sync with the /events
endpoint, meaning it should only return the latest block where data from /events
will be available. This doesn't mean it should return the latest block with an event, but it should not return a block for which /events
has no data available yet.
/events
fetches data on-demand this isn't an issue, but if it relies on data indexed and persisted in the backend then /latest-block
should be aware of the latest persisted block/latest-block
and use its data to then query /events