Skip to content

Instantly share code, notes, and snippets.

@tacyarg
Last active March 28, 2020 01:03
Show Gist options
  • Save tacyarg/f6bd1cfb26447c0d09a63ef7d707bebe to your computer and use it in GitHub Desktop.
Save tacyarg/f6bd1cfb26447c0d09a63ef7d707bebe to your computer and use it in GitHub Desktop.

https://api.fundingrate.io/v2/provider/consumeEvent

Alert Schema

module.exports = config => {
  return {
    id: 'string',
    userid: 'string',
    providerid: 'string',
    created: 'number',
    // meta
    //TODO: adjust schema requirements based on alert type.
    type: 'string', // what alert type is this? LONG/SHORT/BUY/SELL/CLOSE/EDIT
    ticker: 'string', // what ticker symbol is this for?
    condition: 'string', // what is the condition that triggers this alert?
    description: 'string', // what is this alert for?
    timeframe: 'string', // current timeframe
    price: 'number', // price when triggered
    exchange: 'string', // exchange triggered from
    candles: 'string' // candle type
  }
}

Example Alert Message

{
  "token": "YOUR_TOKEN",
  "providerid": "YOUR_PROVIDER",
  "type": "SHORT",
  "condition": "Sell Alert",
  "description": "Range Top",
  "timeframe": "1m",
  "ticker": "{{ticker}}",
  "candles": "Heikin Ashi",
  "exchange": "{{exchange}}",
  "price": {{close}}
}

Example Consumed Event

{
    "candles": "Heikin Ashi",
    "condition": "Buy Alert",
    "created": 1585173480538,
    "description": "Range Bottom",
    "done": false,
    "exchange": "BITMEX",
    "id": "0203e0a4-9988-45c3-93d6-9d242ab7d187",
    "price": 6594.75,
    "providerid": "00760b82-42b9-412d-8be1-bbc63b3930eb",
    "ticker": "XBTUSD",
    "timeframe": "1m",
    "type": "LONG",
    "userid": "2879f997-ae7e-4dcf-93c1-18d324a6b1bb"
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment