Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
bfx-hf-data-server
Advanced tools
The HF data server exposes a websocket interface for querying trade/candle data from Bitfinex, and syncronizes that data in a local DB.
To run, use npm start
Start a data server instance using lib/start
:
const { RESTv2 } = require('bfx-api-node-rest')
const { logDataDBInfo, startDataServer } = require('bfx-hf-data-server')
const run = async () => {
const rest = new RESTv2(...) // create a REST API interface for fetching data
const ds = startDataServer({
port: 8899, // command port number
rest
})
await logDataDBInfo()
}
try {
run()
} catch (e) {
debug(e.stack)
}
Then connect to the command port number (8899
in the above example) and request a backtest by sending an 'exec.bt' command:
['exec.bt', [
from, // start timestamp
to, // end timestamp
symbol, // i.e. 'tBTCUSD'
timeFrame, // i.e. '1m'
candles, // true or false
trades, // true or false
candleFields, // '*' (which candle data fields to return)
tradeFields, // '*' (see above)
sync // true or false, whether to sync missing data
]]
If not all requested data is available locally, the server will first syncronize it before initiating the backtest data stream. In all, the server will reply with any of the following packets:
['bt.sync.start', symbol, timeFrame, from, to]
- when a sync process starts['bt.sync.end', symbol, timeFrame, from, to]
- when a sync process end['bt.start', null, null, from, to, null, nTrades, nCandles]
- before the backtest data stream['bt.end', null, null, from, to]
- after the backtest data stream['bt.candle', null, null, candle]
- individual BT candle['bt.trade', null, trade]
- individual BT tradeCandles are of the form { symbol, open, high, low, close, mts }
, and trades { id, symbol, amount, price }
.
FAQs
HF data server module
The npm package bfx-hf-data-server receives a total of 6 weekly downloads. As such, bfx-hf-data-server popularity was classified as not popular.
We found that bfx-hf-data-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.