INTEGER CONVERSION FOR LOCALLY STORED DATA IN PRIORITY QUEUES
A feed handler is configured to receive a transaction entry from a data feed, the transaction entry indicating at least a floating-point value amount, the data feed associated with a transaction target. The feed handler modifies a locally stored priority queue based on the transaction entry by converting the floating-point value amount in transaction entry to an integer value amount based on a ratio between two underlying components indicated by the transaction target; and storing the integer value amount in a corresponding entry in the locally stored priority queue.
1 . A system comprising:
a feed handler configured to:
receive a transaction entry from a data feed, the transaction entry indicating at least a floating-point value amount, the data feed associated with a transaction target;
modify a locally stored priority queue based on the transaction entry by:
converting the floating-point value amount in the transaction entry to an integer value amount based on a ratio between two underlying components indicated by the transaction target; and
storing the integer value amount in a corresponding entry in the locally stored priority queue.
2 . The system of claim 1 , wherein the data feed is received from a remote data feed server, and wherein the feed handler communicates with the remote feed server using a lean version of Transmission Control Protocol/Internet Protocol (TCP/IP), the lean TCP/IP protocol avoiding a latency due to a TCP/IP handshake.
3 . The system of claim 1 , further comprising a client device connected to the feed handler via a network and configured to: present a graphical user interface to a user of the client device, the interface including one or more web pages presenting data from the locally stored priority queue.
4 . The system of claim 1 , wherein the locally stored priority queue is a binary search tree (BST) that is indexed according to the integer value amount of each entry in the BST.
5 . The system of claim 4 , further comprising a hash table that has as a key a transaction entry identifier and as a value a reference to the corresponding transaction entry in the BST.
6 . The system of claim 1 , wherein the ratio is a ratio between a first unit value of a first underlying component of the two underlying components, and a second unit value of a second underlying component of the two underlying components.
7 . The system of claim 1 , wherein the floating point value is converted to the integer value by:
computing an exponent value based on the ratio;
shifting a decimal position of the floating point value by the exponent to generate a shifted floating point value; and
generating the integer value from the shifted floating point value by rounding the shifted floating point value to an integer.
8 . The system of claim 1 , wherein the floating-point value amount is a relation between a first component and a second component, the floating-point value indicating a requested amount of the second component to exchange for a unit of the first component.
9 . The system of claim 8 , wherein the exchange, once executed, is recorded on one or more blockchains.
10 . The system of claim 1 , wherein the feed handler is configured to receive a plurality of transaction entries from a plurality of different data feeds and combine the data from the plurality of transaction entries into a single locally stored priority queue.
11 . A computer-implemented method, comprising:
receiving a transaction entry from a data feed, the transaction entry indicating at least a floating-point value amount, the data feed associated with a transaction target;
modifying a locally stored priority queue based on the transaction entry by:
converting the floating-point value amount in transaction entry to an integer value amount based on a ratio between two underlying components indicated by the transaction target; and
storing the integer value amount in a corresponding entry in the locally stored priority queue.
12 . The method of claim 11 , wherein the data feed is received from a remote data feed server, and wherein the feed handler communicates with the remote feed server using a lean version of Transmission Control Protocol/Internet Protocol (TCP/IP), the lean TCP/IP protocol avoiding a latency due to a TCP/IP handshake.
13 . The method of claim 11 , further comprising a client device connected to the feed handler via a network and configured to: present a graphical user interface to a user of the client device, the interface including one or more web pages presenting data from the locally stored priority queue.
14 . The method of claim 11 , wherein the locally stored priority queue is a binary search tree (BST) that is indexed according to the integer value amount of each entry in the BST.
15 . The method of claim 14 , further comprising a hash table that has as a key a transaction entry identifier and as a value a reference to the corresponding transaction entry in the BST.
16 . The method of claim 11 , wherein the ratio is a ratio between a first unit value of a first underlying component of the two underlying components, and a second unit value of a second underlying component of the two underlying components.
17 . The method of claim 11 , wherein the floating point value is converted to the integer value by:
computing an exponent value based on the ratio;
shifting a decimal position of the floating point value by the exponent to generate a shifted floating point value; and
generating the integer value from the shifted floating point value by rounding the shifted floating point value to an integer.
18 . The method of claim 11 , wherein the floating-point value amount is a relation between a first component and a second component, the floating-point value indicating a requested amount of the second component to exchange for a unit of the first component.
19 . The method of claim 18 , wherein the exchange, once executed, is recorded on one or more blockchains.
20 . The method of claim 11 , further comprising receiving a plurality of transaction entries from a plurality of different data feeds; and combining the data from the plurality of transaction entries into a single locally stored priority queue.