1.1.5 â€ĸ Published 2 years ago

@cheqd/market-monitoring v1.1.5

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

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

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago