npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cheqd/market-monitoring

v1.1.5

Published

cheqd Market Monitoring API

Downloads

12

Readme

Marketing Monitoring API

GitHub release (latest by date) GitHub Release Date GitHub license

GitHub release (latest by date including pre-releases) GitHub commits since latest release (by date) GitHub contributors

GitHub Workflow Status GitHub repo size

ℹ️ Overview

This repository contains a smaller helper app that fetches the latest price of a given token from the CoinGecko's API and compares its price across different markets to detect if it is susceptible to arbitrage opportunities.

This helper app is used by the Cosmos Custom Data API to trigger alerts in case there are arbitrage opportunities flagged.

📖 Usage

The app is pre-configured to assess arbitrage opportunities for a given token's CoinGecko Token ID, e.g., cheqd-network across all the markets and token pairs it trades on.

The other parameter that needs to be set is a market arbitrage threshold (e.g., 10%), which is the allowed percentage difference allowed before a market pair is counted as susceptible to arbitrage.

The app is invoked hitting the / endpoint (with a GET request), which returns a JSON response with the following details.

Response Details

arbitrageOpportunities

Compares the token price for given token, e.g., CHEQ against a given token pair and calculates the percentage difference between the token price across two different market venues.

{
  "marketPairId": "01",
  "marketName1": "Osmosis",
  "coinPrice1": 0.03859061,
  "coinPair1": "osmosis",
  "marketName2": "Gate.io",
  "coinPrice2": 0.03902044,
  "coinPair2": "tether",
  "arbitragePossible": false,
  "percentageDelta": 1.1076515521952248
}

prices

An array of items containing coinPair, marketName and coinPrice of given token on that market and token pair.

{
  "coinPair": "osmosis",
  "marketName": "Osmosis",
  "coinPrice": 0.03487637
}

Sample Response

{
  "prices": [
    {
      "marketName": "Osmosis",
      "coinPair": "osmosis",
      "coinPrice": 0.03859061
    },
    {
      "marketName": "Gate.io",
      "coinPair": "tether",
      "coinPrice": 0.03902044
    }
  ],
  "arbitrageOpportunities": [
    {
      "marketPairId": "01",
      "marketName1": "Osmosis",
      "coinPrice1": 0.03859061,
      "coinPair1": "osmosis",
      "marketName2": "Gate.io",
      "coinPrice2": 0.03902044,
      "coinPair2": "tether",
      "arbitragePossible": false,
      "percentageDelta": 1.1076515521952248
    }
  ]
}

🧑‍💻🛠 Developer Guide

Setup

Dependencies can be installed using NPM or any other package manager.

npm install

Configuration

The application expects two environment variables to be defined for the app to function:

  1. MARKET_ARBITRAGE_THRESHOLD: Percentage difference to consider for arbitrage threshold. (Default: 10.0 or 10%)
  2. COINGECKO_TOKEN_ID: CoinGecko token ID ("name"), which is usually the name of the token's profile page on CoinGecko. (Default: cheqd-network for the CHEQ token)

Run

Once configured, the app can be run using NPM:

npm start

Or, to build and run in Docker, use the Dockerfile provided.

🐞 Bug reports & 🤔 feature requests

If you notice anything not behaving how you expected, or would like to make a suggestion / request for a new feature, please create a new issue and let us know.

💬 Community

The cheqd Community Slack is our primary chat channel for the open-source community, software developers, and node operators.

Please reach out to us there for discussions, help, and feedback on the project.

🙋 Find us elsewhere

Telegram Discord Twitter LinkedIn Slack Medium YouTube