In certain markets, such as the spot foreign exchange (spot FX) market, trading may require the existence of a bilateral credit relationship between the two counterparties to a trade, as opposed to the existence of a central counterparty as is the norm in equities and futures markets. To that end, electronic spot FX trading venues tend to provide functionality to participants on that venue to specify credit lines they are extending to other such participants. The venue may then determine from those bilateral credit lines if a trade between two participants can occur or not and if it can drawdown those credit lines by the size of the trade, for example, by examining the lines existence, magnitude and type.
In the pursuit of performance, such as achieving low-latency and high-throughput in order processing, horizontal scaling is often employed extensively in the architecture of many electronic trading venues. Horizonal scaling may refer to the addition of computational resources such as computers and/or other devices to increase the capacity of a computer system or network. To that end, such electronic trading venues tend to be composed of a plurality of order gateway components, a plurality of matching engine components, and a plurality of market data distribution components. These components may be implemented as distinct programs, modules or engines within the electronic trading venue, each designed to perform particular tasks or functions.
For such electronic trading venues also implementing risk checking componentsthat in the context of spot FX such components may be used or otherwise repurposed to perform credit checking i.e., storing, interrogating, and drawing down bilateral credit lines-conventionally those too may be horizontally scaled.
A number of problems become apparent in attempting to horizontally scale the credit system on an electronic spot FX trading venue. First, certain types of credit limits such as net credit do not lend themselves well to being partitioned among distinct components in the required manner, such that the components can operate substantially independently of one another. Second, if the credit universe is represented as a directed graph-where the nodes of which are participants, and edges of which are credit relationships of varying type and magnitude, noting that other specific mappings to edges and to nodes may exist-then the graph tends to be connected which inhibits partitioning it across distinct components. Third, in the presence of prime brokerage relationships and in the presence of groups of limits being imposed on pluralities of currencies, instruments, or counterparties, and in conjunction with ungrouped limits, partitioning credit limits among substantially independent components is further inhibited.
These and other problems motivate the need for a high-performance credit system on electronic trading venues where trades involve bilateral credit between participants.
The disclosure relates to systems, methods, and computer-readable media for a deterministic credit system to provide high-performance credit-checking while reducing the need for horizontal scaling or implementing larger system architecture. The systems and methods presented herein may achieve this in several ways, for example, by: storing credit lines in memory; optimizing the storage of those lines in memory and performing precomputations on them so as to minimize operations performed on them; and minimizing disk and network I/O by (i) persisting inputs to the credit checking computations and (ii) ensuring those computations are deterministic, consequently eliminating the need to persist or transmit the outputs of those computations.
Features of the present disclosure may be illustrated by way of example and not limited in the following Figure(s), in which like numerals indicate like elements, in which:
Systems and methods of a deterministic credit system are disclosed to provide high-performance credit-checking while reducing the need for horizontal scaling or implementing larger system architecture. The systems and methods presented herein may achieve this in several ways, for example, by: storing credit lines in memory; optimizing the storage of those lines in memory and performing precomputations on them so as to minimize operations performed on them; and minimizing disk and network I/O by (i) persisting inputs to the credit checking computations and (ii) ensuring those computations are deterministic, consequently eliminating the need to persist or transmit the outputs of those computations.
On a conventional electronic trading venue, market participants specify credit lines, including attributes thereof such as their size and type, that they are extending to other such participants via a credit administration engine. In conventional systems, participants may access the credit administration engine via a graphical user interface (GUI) and/or application program interface (API). Upon joining such a venue, a participant may be required by the venue operator to extend credit to a minimum number of other participants on the venue, and those credit relationships once established may persist until they are modified by either the venue operator, for example by removal of a line because a counterparty to which the participant has extended credit has left the venue, or by the participant, for example because the creditworthiness of a specific counterparty has improved and correspondingly the line extended to that participant can be increased.
Besides allowing specification of the magnitude of a credit line being extended, conventional electronic trading venues may also allow the specification of various types of lines and groups thereof. A common type of line is a gross limit. In this type of line, the magnitudes of the trades are summed without regard to their direction (buy or sell). For instance, a buy of $1.5 million and sell of $2.5 million would, under a gross limit scheme, draw down $4 million (=1.5 million +2.5 million) of credit from the line. Another common type of line is a net limit. In this type of line, the directions of trades are material in computing their drawdown. Nominally, buys are positive values and sells are negative values, so in the previous example the drawdown would be -$1 million (=1.5 million-2.5 million). To allow summation in spot FX, magnitudes of the trades may be expressed in a currency of the participant’s choosing using a conversion rate; lines a participant extends may also be expressed in that same currency.
Conventional electronic trading venues may also allow participants to specify arbitrary groupings of credit lines they have extended that may or may not co-exist or even “overlap” with those ungrouped lines they have also extended. A non-limiting example that will ultimately serve to illustrate complications arising from this is provided as follows: a participant extends a single gross line to a group of counterparties all domiciled in a certain country, and further extends individual gross lines to each such counterparty in the country. The combination of these lines may allow the participant to express that they are unwilling to extend more than, for example, $100 million credit in the aggregate to all counterparties in that country. However, the sum of the individual lines extended across all such participants may actually exceed that $100 million. For example, say there are five distinct participants each extended between $30 million and $50 million each. Since, conventionally, among a plurality of credit lines extended to a counterparty it is the lowest line that is controlling, a setup like the one described can advantageously allow a participant to express their credit risk in terms of both a country and of individual counterparties domiciled there advantageously without, for example, continuously having to “rebalance” limits on the venue as trades draw them down.
Conventionally on FX venues, arbitrary grouping of credit lines on attributes in addition to counterparties may also exist, such as: currency, instrument, tenor, type and so on. These too may also co-exist and/or overlap, and given that it is the lowest line among all those extended to a counterparty that is the controlling one, other groupings may be used to similar effect. For example, Continuous Linked Settlement (CLS)-eligible currencies may be grouped together, or prime brokerage clients belonging to a single prime broker may be grouped together for the extension of shared credit among them to venue counterparties, while simultaneously imposing individual net limits on each such prime brokerage client.
Having described the specification of credit lines on a conventional electronic trading venue, attention is now given to how such a venue makes use of those lines to form trades between participants. Typically, such a venue will also include a credit checking component. In an example of the present disclosure involving a deterministic credit system, only one such component is necessary, while conventional venues may include a plurality of such horizontally-scaled components and certain parts of their functionality may even exist as subcomponents within matching engine components. Regardless of how the credit check component(s) manifest however, conventionally they receive credit line information from the venue’s credit admin component. Also conventionally, trades between participants are partially-formed on the venue in the matching engine component, for example, based on price-compatibility, and these partially formed trades are sent to the credit check component to either be (i) completed as a result of a successful credit check, or (ii) unwound as a result of a failed credit check. Pertinent aspects of this workflow are illustrated in
The credit admin engine 120 may provide an interface to a plurality of market participants, such as market participants 101A, 101B... 101N. The credit admin engine 120 may provide the interface to create credit lines for each market participant 101A... 101N initially, in order to allow participation in the electronic trading venue 110. Later, the credit admin engine 120 may provide the interface to modify any of the credit lines for the market participants 101A... 101N.
To establish the credit lines, the credit admin engine 120 may send the credit line information to the credit checking engine 130. The credit checking engine 130 may perform crediting checking using partially-formed trades against the credit lines. The partially-formed trades may be obtained by the credit checking engine 130 from the matching engine 140. The credit checking engine 130 may also be programmed to transmit completed trades and any unwound trades to the matching engine 140.
In an example of a deterministic credit system of the present disclosure, at the start of, or immediately prior to, the electronic trading venue’s 110 trading session, all credit line information may be transferred from the credit admin engine 120 to the credit checking engine 130. Each such line may be transferred over a network connection, such as TCP/IP, as a single record containing: a unique identifier for the line, the counterparty extending the credit, the counterparty to which credit is being extended, the type of the limit as an enumeration, and the magnitude of the limit as a numeric value, as some examples. Upon receipt of all those credit line records and before the electronic trading venue 110 begins conducting the trading session, the credit checking engine 130 may then efficiently store them in memory, utilizing the following techniques:
1. Prune records where bilateral credit does not exist. A successful trade requires that both counterparties have extended credit to one another. Since conventionally a counterparty only knows those to whom they have extended credit, and not those that have extended them credit, it is possible “one-sided” lines exist. These one-sided lines can be “pruned” in the sense that they may be removed from memory or otherwise ignored by the credit checking engine 130 because they can never result in trades. Such pruning can reduce the size of the data structure in which the records are stored and thus may advantageously improve performance by reducing lookup times thereon.
2. Create a single key for each distinct pair of counterparties. To further improve lookup times on the data structure in which credit lines are stored, each distinct pair of counterparties can be assigned a unique key. For example, in the case that there are less than 232 distinct counterparties on the venue and where the computer architecture uses 64-bit words, each counterparty can be assigned a unique 32-bit integer identifier. The assignment of such an integer may be done by the venue operator and its lookup and insertion into a message received from a market participant may be performed by an order gateway 150. A single key for each distinct pair of counterparties can then be generated by concatenating the bitstrings of the two counterparty’s integers, nominally using the smaller integer as the left and larger as the right in that concatenation, as one example. In one example implementation, as integer operations, this concatenation may be expressed as a cast of the smaller 32-bit integer to a 64-bit integer, a shift left on it by 32 bits, and finally by adding to it or bitwise boolean OR’ing it with the second integer.
3. Merge congruent records where bilateral credit lines exist. Certain types of credit lines among a pair of counterparties are “congruent” when they can be merged into a single record with a single limit, which is the lesser of the two limits among the two being merged. For example, if counterparty A extends B net credit of $10 million in a single credit line, and counterparty B extends A net credit of $8 million in another single credit line, then the smaller of the two limits is controlling and this can be precomputed and stored in a single record upon receipt of the credit lines. In this way, such precomputation can reduce the time taken to perform the credit check and drawdown because instead of comparing the partially formed trade to both limits, only one such comparison operation (and drawdown operation) is necessary. The precomputation may be performed at the start of the trading session after all credit lines have been received.
4. Aliasing of credit limits as values in the data structure. Aliasing may refer to a computer programming term where two or more references to the same object exist in a computer program’s object graph. Noting that some credit lines involve groups of counterparties, rather than creating a new object for each such counterparty in the group such that multiple duplicate objects would be brought into existence, a single object representing the credit line can be created and shared by all affected counterparties. For example, if the data structure in which the credit checking engine 130 storing credit lines is a hashmap, the keys of which are pairs of counterparties stored as 64-bit integers and each value of which is a set of credit lines, then aliasing can ensure the same credit line object appears in multiple such sets. In this way, this aliasing may improve performance by reducing the number of lookup operations on the hashmap and correspondingly the number of comparison and drawdown operations when a credit check involves a group limit.
At 208, the credit checking engine 130 may merge pairs of congruent unilateral credit line records into a single bilateral credit line record with the lower of the two limits being set as its limit. This is another further optimization to reduce latency and processing power during a trading session. At 210, the electronic trading venue 110 may populate mapping of credit lines with the combined-identification keys and the set of credit lines involving the pair of the participants as values. The credit lines of the groups of participants may be aliased across these sets. An example of the type of mapping may be the hashmap of credit lines. This may be performed by the credit checking engine 130 as an example.
For reasons described earlier, it is clear that, even for a single pair of participants, there may exist a plurality of (bilateral) credit lines and that the process of completing or unwinding a partially-formed trade may involve checking a large number of them. It is observed then that the volume of data output from such a computation may far exceed the volume of its (incremental) input. Disadvantageously then, transmitting the output of such a computation over a computer network or from memory to disk for the purposes of auditability, fault-tolerance, recovery and so on may be slow and thus detrimental to venue performance.
To address at least these issues, in an example of the deterministic credit system of the present disclosure, inputs to the credit checking engine 130 are sequenced and computations performed thereon are specifically designed to be deterministic. Under these two conditions, the potentially voluminous outputs of computations need not be transmitted over a computer network, or from memory to disk. Instead, for the purposes of auditability, fault-tolerance, recovery and the like, it is sufficient to transmit only the sequenced inputs. Since those inputs will tend to be smaller, performance as judged by latency and throughput, for example, will advantageously be improved on venues implementing deterministic credit checking as described herein.
While the credit lines themselves are likely very voluminous inputs to the process of credit checking, the initial transmission of those lines to the credit checking engine 130 from the credit admin engine 120 does not affect venue performance. This is because, as noted earlier, the transmission of the credit lines may occur prior to the beginning of trading session. Further, if a trading session has not commenced, then participants cannot submit orders or receive market data, so the trading session may be unaffected by performance characteristics of the venue during this time.
In certain schemes such as those described in U.S. Provisional Patent 63/233,038 titled “Pipelined Credit Checking,” some of the responsibility for matching of price-compatible contra-orders and for executing advanced order types, such as icebergs, is shifted from the matching engine 140 into the credit checking engine 130. Certain aspects of that functionality may require randomization inside the credit checking engine 130, which ostensibly may seem at odds with the determinism of computations that is required for their inputs to be transmitted rather than their outputs. A technique for achieving pseudo-randomization in this context is thus disclosed.
Pseudo-randomization for deterministic computations. In some examples of the deterministic credit system of the present disclosure, relevant computation only occurs upon receipt of an input message, such as a partially-formed trade. Consequently, randomization is only invoked when an input message is received that includes an action whose computation requires it—and crucially not at any other time. A pseudo-random number generator (PRNG) can thus be utilized that takes as its seed data exclusively derived from the input message, ultimately requiring the use of randomization in its computation. To appear random, the data chosen from the message must be substantially independent of the things in it requiring randomization. If the ordering of the two participants appearing in a partially-formed trade requires randomizing, then the identifiers of those two participants appearing in the input message would not be good candidates for input to a PRNG’s seed.
Example inputs to the PRNG’s seed may be a unique, monotonically increasing integer trade identifier generated by and inserted into the message by the matching engine 140, or a monotonically increasing integer message sequence number assigned to the message and generated by an engine of the electronic trading venue 110 that sequences messages before they are sent to the credit checking engine 130. If the size of the data desired to be used as a seed from the message exceeds that required by the PRNG, it may be hashed down to an appropriate length (for example, 64 bits) using an off-the-shelf hashing algorithm.
Having described above certain optimizations of the present disclosure before trading sessions are conducted,
Under normal operation, only the live credit checking engine 130-1 need send completed and unwound trades back to the matching engine 140, but in a failure scenario the backup credit checking engine 130-2 may provide this function and the backup credit checking engine 130-2 may operate in live-mode for near instantaneous failover. The matching engine 140 may be programmed to send (initially) unsequenced and partially-formed trades (or a plurality of price-compatible contra orders per U.S. Provisional Patent 63/233,038) to the sequencer 310, and then the sequencer 310 sequences and distributes them to each of the credit admin engine 120, live credit checking engine 130-1, and backup credit checking engine 130-2. The credit admin engine 120 may be programmed to send, to the sequencer 310, unsequenced changes to updated credit lines resulting from a market participant manually editing a credit line, for example, to increase it, remove it, etc., intra-session. The sequencer 310 may then also sequence and distribute these to each of the credit admin engine 120, live credit checking engine 130-1, and backup credit checking engine 130-2. The sequencer 310 may also send other credit changes that may occur intra-session, such as a value date rollover for a particular instrument as updated lines.
The credit admin engine 120 contains the deterministic computation logic because, among other things, it can provide to participants a contemporaneous view of the credit they have utilized. The credit remaining across a participants lines, of course, is affected by the trades that occur during the trading session and will usually decrease as a result of those trades. The credit admin engine 120 may also provide to participants data on trades that have failed due to missing or exhausted credit lines, and this too is calculated as a matter of course by the deterministic computation logic.
Although not illustrated, it should be noted that each market data distributor 160 illustrated in
A flowchart 400 illustrating selected logic in the credit checking engine 130 in an example of the invention is provided in
The interconnect 510 may interconnect various subsystems, elements, and/or components of the computer system 500. As shown, the interconnect 510 may be an abstraction that may represent any one or more separate physical buses, point-to-point connections, or both, connected by appropriate bridges, adapters, or controllers. In some examples, the interconnect 510 may include a system bus, a peripheral component interconnect (PCI) bus or PCI-Express bus, a HyperTransport or industry standard architecture (ISA)) bus, a small computer system interface (SCSI) bus, a universal serial bus (USB), IIC (I2C) bus, or an Institute of Electrical and Electronics Engineers (IEEE) standard 1364 bus, or “firewire,” or other similar interconnection element.
In some examples, the interconnect 510 may allow data communication between the processor 512 and system memory 518, which may include read-only memory (ROM) or flash memory (neither shown), random-access memory (RAM), and/or other non-transitory computer readable media (not shown). It should be appreciated that the RAM may be the main memory into which an operating system and various application programs may be loaded. The ROM or flash memory may contain, among other code, the Basic Input-Output system (BIOS) which controls basic hardware operation such as the interaction with one or more peripheral components.
The processor 512 may control operations of the computer system 500. In some examples, the processor 512 may do so by executing instructions such as software or firmware stored in system memory 518 or other data via the storage adapter 520. In some examples, the processor 512 may be, or may include, one or more programmable general-purpose or special-purpose microprocessors, digital signal processors (DSPs), programmable controllers, application specific integrated circuits (ASICs), programmable logic device (PLDs), trust platform modules (TPMs), field-programmable gate arrays (FPGAs), other processing circuits, or a combination of these and other devices.
The multimedia adapter 514 may connect to various multimedia elements or peripherals. These may include devices associated with visual (e.g., video card or display), audio (e.g., sound card or speakers), and/or various input/output interfaces (e.g., mouse, keyboard, touchscreen).
The network interface 516 may provide the computer system 500 with an ability to communicate with a variety of remote devices over a network. The network interface 516 may include, for example, an Ethernet adapter, a Fibre Channel adapter, and/or other wired- or wireless-enabled adapter. The network interface 516 may provide a direct or indirect connection from one network element to another, and facilitate communication and between various network elements.
The storage adapter 520 may connect to a standard computer readable medium for storage and/or retrieval of information, such as a fixed disk drive (internal or external).
Other devices, components, elements, or subsystems (not illustrated) may be connected in a similar manner to the interconnect 510 or via a network. The network may include any one or more of, for instance, the Internet, an intranet, a PAN (Personal Area Network), a LAN (Local Area Network), a WAN (Wide Area Network), a SAN (Storage Area Network), a MAN (Metropolitan Area Network), a wireless network, a cellular communications network, a Public Switched Telephone Network, and/or other network.
The devices and subsystems can be interconnected in different ways from that shown in
In
For simplicity and illustrative purposes, the disclosure included descriptions that may refer to examples. In the description, numerous specific details have been set forth in object to provide a thorough understanding of the present disclosure. It will be readily apparent however, that the disclosure may be practiced without limitation to these specific details. In other instances, some methods and structures have not been described in detail so as not to unnecessarily obscure the present disclosure. In some instances, various method operations may be omitted and the various method operations are not necessarily performed in the object in which they are presented.
Throughout the disclosure, the term “a” and “an” may be intended to denote at least one of a particular element. As used herein, the term “includes” means includes but not limited to, the term “including” means including but not limited to. The term “based on” means based at least in part on.
Although described specifically throughout the entirety of the instant disclosure, representative examples of the present disclosure have utility over a wide range of applications, and the above discussion is not intended and should not be construed to be limiting, but is offered as an illustrative discussion of aspects of the disclosure. What has been described and illustrated herein is an example of the disclosure along with some of its variations. The terms, descriptions and figures used herein are set forth by way of illustration only and are not meant as limitations. As such, the disclosure is intended to be defined by the following claims -- and their equivalents -- in which all terms are meant in their broadest reasonable sense unless otherwise indicated.
This application claims priority to U.S. Provisional Pat. Application No. 63/233,038, filed Aug. 13, 2021, entitled “Pipelined Credit Checking,” and U.S. Provisional Pat. Application No. 63/237,651, filed Aug. 27, 2021, entitled “Deterministic Credit System,” the contents of each of which are incorporated by reference in their entireties herein.
Number | Date | Country | |
---|---|---|---|
63237651 | Aug 2021 | US | |
63233038 | Aug 2021 | US |