Skip to content

Latest commit

 

History

History
267 lines (200 loc) · 6.93 KB

File metadata and controls

267 lines (200 loc) · 6.93 KB

Chainlink Tiingo External Adapter

Environment Variables

Required? Name Description Options Defaults to
API_KEY An API key that can be obtained from here

Websocket support

This adapter has Websocket support. However, the Tiingo WS API only offers price updates from individual exchanges with no aggregation. Because of this, Tiingo WS should not be used to provide data to the Chainlink price feeds. To avoid node operators accidentally running this with WS enabled, WS will only be enabled when run in development mode. To enable WS, set NODE_ENV=development in addition to WS_ENABLED=true.


Input Parameters

Required? Name Description Options Defaults to
endpoint The endpoint to use eod, iex or stock, top, prices or crypto, volume, forex, fx or commodities crypto

EOD Endpoint

https://api.tiingo.com/documentation/end-of-day

Input Params

Required? Name Description Options Defaults to
ticker, base, from, or coin The stock ticker to query
field The value to return close

Sample Input

{
  "id": "1",
  "data": {
    "ticker": "aapl",
    "field": "close"
  }
}

Sample Output

{
  "jobRunID": "1",
  "data": {
    "result": 130.27
  },
  "result": 130.27,
  "statusCode": 200
}

IEX Endpoint

https://api.tiingo.com/documentation/iex

Input Params

Required? Name Description Options Defaults to
ticker, base, from, or coin The stock ticker to query
field The value to return tngoLast

Sample Input

{
  "id": "1",
  "data": {
    "ticker": "aapl"
  }
}

Sample Output

{
  "jobRunID": "1",
  "result": 130.125,
  "statusCode": 200,
  "data": {
    "result": 130.125
  }
}

Top Endpoint

The top of order book endpoint from:

https://api.tiingo.com/documentation/crypto

Input Params

Required? Name Description Options Defaults to
base, from, or coin The cryptocurrency symbol to query
quote, to, or market The output currency to return the price in
field The value to return lastPrice

Sample Input

{
  "id": "1",
  "data": {
    "base": "btc",
    "quote": "usd"
  }
}

Sample Output

{
  "jobRunID": "1",
  "data": {
    "result": 130.27
  },
  "result": 130.27,
  "statusCode": 200
}

Prices Endpoint

Crypto prices endpoint from:

https://api.tiingo.com/documentation/crypto

This endpoint does a VWAP of all the exchanges on the current day and across base tokens.

Input Params

Required? Name Description Options Defaults to
base, from, or coin The cryptocurrency symbol to query
quote, to, or market The output currency to return the price in
field The value to return lastPrice

Sample Input

{
  "id": "1",
  "data": {
    "base": "btc",
    "quote": "usd"
  }
}

Sample Output

{
  "jobRunID": "1",
  "data": {
    "result": 130.27
  },
  "result": 130.27,
  "statusCode": 200
}

Volume Endpoint

Crypto prices endpoint from:

https://api.tiingo.com/documentation/crypto

This endpoint gets the 24h volume for a pair

Input Params

Required? Name Description Options Defaults to
base, from, or coin The cryptocurrency symbol to query
quote, to, or market The output currency to return the price in
field The value to return lastPrice

Sample Input

{
  "id": "1",
  "data": {
    "endpoint": "volume",
    "base": "btc",
    "quote": "usd"
  }
}

Sample Output

{
  "jobRunID": "1",
  "data": {
    "result": 6034249067.971378
  },
  "result": 6034249067.971378,
  "statusCode": 200
}

--

Forex Endpoint

Aliases: fx, commodities

https://api.tiingo.com/documentation/forex

Input Params

Required? Name Description Options Defaults to
base, asset, market or from The asset to query
quote or to The quote to convert to
resultPath The result path to return midPrice

Sample Input

{
  "id": "1",
  "data": {
    "endpoint": "forex",
    "from": "GBP",
    "to": "USD"
  }
}

Sample Output

{
  "jobRunID": "1",
  "data": {
    "result": 1.33605
  },
  "result": 1.33605,
  "statusCode": 200
}