Skip to main content
In this guide we’ll build a nodejs application that listens for price changes on a token in realtime. We’ll show how to do it two ways, one with webhooks and another with subscriptions.

Webhooks

Install the Codex SDK
Create a new file called index.js and add the following code:
Now we have to add the token address and network id to code so we can start listening for price changes.
Next, we’ll need be able to receive webhook deliveries on our local computer. Let’s use loophole to do this. https://loophole.cloud/download After getting that setup and seeing your loophole url, copy it and save it for later. Now lets make the request to make a webook subscription, replacing the value for the host

Subscriptions