Practice utilizing Dune Analytics, Live Fetch functionality for interfacing with external data exposed through api(application programmable interfaces) endpoints. For this use-case, as data is retrieved as opposed to sent, the
http_get
method was employed.
Pump.fun
was selected for this instance due to relevance and possible extended use-case application.
Due to the lack of developer documentation, a cursory review of the Pump.fun
frontend functionality was done using the Mullvad Browser and developer tools.
The Pump.fun
frontend, displayed a variety of endpoints utilized by the website via the Network
tab. When the instance was filtered for specifically XHR Requests as we are searching for potential data endpoints, it was observed an API instance for Pump.Fun
was available:
https://frontend-api.pump.fun/coins?offset=0&limit=100&sort=last_trade_timestamp&order=DESC&includeNsfw=false
Parsed URI for reference:
From this point, accessibility to the API was tested by pasting the endpoint into a browser url-bar. A valid response was returned, as such, said response was reviewed in greater depth. It was observed the response was composed of an array with nested JSON Objects, each object appeared to be of a consistent structure, so a singular object was copied for conversion into a generic structure, this structure is not necessarily needed, however this step undertaken to facillate implementing the API when composing the query utilized through Dune Analytics.
Sample of singular object copied available below:
Generic typescript structure:
The data was converted into a generic reference structure to ensure data type accuracy when the unit is referenced via Dune Analytics. In this particular case, a Typescript structure was employed as it was the most familiar(any other programming language does the same).
Dune Analytics query
https://dune.com/queries/3951402?sidebar=none