tiagosiebler / orderbooks

Simple utility classes to handle orderbook snapshot & delta events in node.js, with examples for Bybit & Binance.
131 stars 34 forks source link

Spread to basis points and improved print format #20

Closed damian123 closed 1 year ago

damian123 commented 1 year ago

Summary

This pull request includes updates to the getSpreadPercent() method to return spread in basis points instead of percentages. The print() method has also been updated to improve the format of the displayed order book.

Additional Information

The changes in this PR include:

  1. The method getSpreadPercent() has been renamed to getSpreadBasisPoints(). This method now returns the spread in basis points between the bid and ask exchange rates.

  2. The print() method has been updated to display the spread in basis points and to remove one redundant index column in the table. The header has also been fixed to match what is shown in the documentation.

The changes in this PR do not introduce any breaking changes or add any dependencies. It simply updates existing functionality to improve the precision of spread measurement and enhances the readability of the order book.

socket-security[bot] commented 1 year ago

Updated and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
binance 1.4.0...2.8.9 None +6/-4 956 kB tsts123

🚮 Removed packages: orderbooks@1.1.3