Singapore Court of Appeal (“CA“) decision in Quoine Pte Ltd v B2C2 Ltd  SGCA(I) 2 is groundbreaking for its analysis of contract formation through a deterministic algorithm code. Case summary here.
The majority of the CA (Jonathan Mance IJ dissenting) decided on the following key points:
When analysing mistake for contract vitiation, if a contract was formed through deterministic algorithms (i.e. it always produces the same output given the same input), it is the programmer’s state of knowledge that is relevant and to be attributed to the parties: at .
The inquiry should be whether, when programming the algorithm, the programmer was doing so with actual or constructive knowledge of the fact that the relevant offer would only ever be accepted by a party operating under a mistake and whether the programmer was acting to take advantage of such a mistake: at .
The relevant time frame within which the knowledge of a programmer or the person running the algorithm should be assessed is from the point of programming up to the point that the relevant contract was formed: at .
The CA held it was not necessary to decide whether cryptocurrency, specifically BTC, was a species of property that was capable of being held on trust. No express trust arose over the BTC in B2C2’s account as there was no certainty of intention to create a trust. The mere fact that Quoine’s assets were segregated from its customers’ could not in and of itself lead to that conclusion. On the facts, the manner in which the BTC was stored militated against the finding of a trust: at  and .
The CA did comment in obiter dicta that “[t]here may be much to commend the view that cryptocurrencies should be capable of assimilation into the general concepts of property. There are, however, difficult questions as to the type of property that is involved”: at .
Case Update on Court of Appeal’s Decision
See original case update below on the facts of the case.
Key extracts from the majority’s judgment below:
“[A] deterministic computer program or algorithm is bound by the parameters set by the programmer, and can (and generally will) only do what the programmer has programmed it to do. Given a particular input, it will produce a particular output; on each occasion, the output should and will be the same if the former does not change. Therefore, when it comes to assessing the state of knowledge that is to be attributed to the parties at the time of a contract made by way of deterministic algorithms, the relevant inquiry cannot be directed at the parties themselves, who had no knowledge of or direct personal involvement in the formation of the contract. Rather, working backwards from the output that emanated from the programs, we are driven to assess the relevant state of knowledge by examining that of the programmers” at .
“the point of programming is when the programmer’s knowledge is the most concretised. The question can first be framed in this way: if the algorithm was programmed to produce a particular output, why was this done? But the inquiry cannot end there and must extend past that point of time because there may be situations where a programmer or the person running the algorithm who did not contemplate the relevant mistake at the point of programming came to learn of it subsequently before the contract had been formed, and yet allowed the algorithm to continue running, intending thereby to take advantage of the mistake. In such a case, it would be wrong to ignore the subsequent acquisition of knowledge. This is why it is appropriate to have regard to the state of knowledge up to the time of the contract”: at .
“when programming the algorithm, was the programmer doing so with actual or constructive knowledge of the fact that the relevant offer would only ever be accepted by a party operating under a mistake and was the programmer acting to take advantage of such a mistake?”: at .
“the framework we have developed also enables the court to examine and consider the knowledge actually acquired after the point of programming and the actual conduct of the parties up to the time of the contract. However, we emphasise that this is directed at actual conduct. This is to be contrasted with the approach that Quoine urged upon us, which we have rejected (see  above), which was to analyse the matter by reference to a “hypothetical meeting on the trading floor that notionally took place just before the contract was concluded in the light of the information available at that time”. On that approach, the question posed is whether the parties would have agreed to the contract with knowledge of the mistake. With respect, this is, as we have mentioned, a wholly artificial analysis that has no relation to the reality of the situation, which is that the trades were conducted by way of algorithmic trading and not by way of an imagined meeting on some trading floor. The consequence of this is that the parties had committed to transact with each other in a certain way which entailed that they would not even know whether a contract would be formed, and if it were, on what terms that would be, and they chose in these circumstances not to bargain for a right to review, confirm or invalidate any ensuing contract that might emerge out of the arrangements that they had committed to”: at .
In Jonathan Mance LJ’s dissenting judgment, he considered that equitable unilateral mistake would apply given the fundamental mistake.
“The reaction of any human trader viewing the transactions as executed would have been that they were fundamentally misconceived – the result of some fundamental mistake leading to terms for the sale of BTC to which no seller of BTC would, in prevailing market conditions, agree”: at .
“In these circumstances, the enquiry therefore moves to the more flexible
area of unilateral mistake in equity. … The question is whether, where two parties well know that there has been a fundamental mistake as soon as a computerised transaction comes to their attention, where no detriment has occurred and no relevant third party interests intervened, and where the mistake could readily be rectified, the law will enforce the contract regardless. For the reasons I will give, in my opinion, the law should and can in such circumstances hold that the contract is voidable, as Quoine claims”: at .
“The Judge’s [and the Majority’s] approach involves omitting a usually important element in any appraisal of such a situation, namely (here) whether there was anything drastically unusual about the surrounding circumstances or the state of the market to explain on a rational basis why such abnormal prices could occur, or whether the only possible conclusion was that some fundamental error had taken place, giving rise to transactions which the other party could never rationally have contemplated or intended”: at .
“The key question is, therefore, whether the law of unilateral mistake falls to be applied in a manner which leaves out of consideration circumstances which are normally central to its application, simply because the parties entrusted their dealings to computers which can have no such consciousness. In my opinion, it does not and should not. The law must be adapted to the new world of algorithmic programmes and artificial intelligence, in a way which gives rise to the results that reason and justice would lead one to expect. The introduction of computers no doubt carries risks, but I do not consider that these include the risk of being bound by an algorithmic contract, which anyone learning of would at once see could only be the result of some fundamental error in the normal operation of the computers involved. Computers are outworkers, not overlords to whose operations parties can be taken to have submitted unconditionally in circumstances as out of ordinary as the present. I do not think that the obvious malfunctioning of a computer-based system should be given the dominance that B2C2’s case implies”: at .
“There is nothing surprising, impermissible or unworkable therefore about a test which asks what any reasonable trader would have thought, given knowledge of the particular circumstances. That is the proper approach, in my opinion, in the present situation. Whether the unknown activities of two computers in the middle of the night should bind the parties should be judged by asking whether any reasonable trader, on the relevant exchange, knowing what was happening (or what had happened) could or would have thought, in the otherwise prevailing circumstances, that this was anything other than the consequence of a gross and unintended “major database breakdown” or error with equivalent effect. Since this is how B2C2 actually categorised it, the answer is doubly obvious. Of course, this test involves a hypothetical, as the Judge said at . But it does not work on the basis of speculation as to what “might” have happened if a human element had been involved. On the contrary, it provides relief in equity in the present case because any reasonable person, knowing of the relevant market circumstances, would have known that there was a fundamental mistake. It is the Judge’s approach which seems to me, to use his word, “artificial” in assessing whether the contract can stand, not by reference to the circumstances and time when it was made, but on the basis that Mr Boonen would have to be shown to be aware in advance that the only circumstances in which a contract could come into existence at his deep prices would be if some fundamental mistake occurred. That prevents any assessment of the validity of computer-made contracts as and when made, and potentially enables traders to make what an honourable and reasonable trader would, I believe, identify as an unjustified windfall – and would expect to forego because it was such”: at .
Original Case Update
SICC decision in B2C2 v Quoine is groundbreaking. A few comments:
1. Cryptocurrency is deemed akin to property which can be held on trust. Significance: crypto assets will be ringfenced if trustee becomes insolvent.
2. Cryptocurrency exchange platform (or any other type of digital exchange) must expressly contract for the right to reverse trades in certain scenarios.
3. In determining the application of the legal doctrine of unilateral and common mistake, the court considered the knowledge and intent of the programmer of the trading algorithm—whether the algo was intended to be opportunistic of mistakes. Strangely, it’s possible that if a human was the one who executed the same trades, the doctrine may apply to deny the plaintiff’s claim.
4. Significance: legal doctrine is being bent by algorithm and technology. This decision may pave the approach for application of doctrine to scenarios of automated technology replacing human actors.
5. Remedy in this case was not return of the cryptocurrency because of the substantial value increase since the events. Instead damages were to be assessed. This may matter if the defendant is cash light.
Supreme Court Summary found here.
Case summary below written with assistance of Myat Thu Phone:
SICC finds operator of virtual currency exchange platform liable for breach of contract and breach of trust in reversing trades made at an abnormal rate
- One of the first judgments to apply law to contract to virtual currencies
- Found that virtual currencies have the hallmark characteristics of property
- Applied the law of unilateral mistake to a case involving algorithmic trading
This is an action for breach of contract and breach of trust.
The Defendant (Quoine) operates a currency exchange platform enabling third parties to trade virtual currencies for other virtual currencies, or for fiat currencies.
The Plaintiff (B2C2), an electronic market maker, is one of the parties that traded on this platform.
On 19 April 2017, B2C2 made seven trades on Quoine, selling Ethereum (ETH) at about 9.99999 or 10 Bitcoin (BTC) for 1 ETH. This was approximately 250 times the going rate of 0.04 ETH to 1 BTC. Sale proceeds of 3092.517116 BTC were automatically credited to B2C2’s account and a corresponding amount of 309.2518 ETH was debited from its account.
When the Chief Technology Office of Quoine became aware of the trades the next morning, he considered the exchange rate to be so abnormal a deviation from the going rates that the trades should be reversed. Quoine cancelled the seven trades and the credit and debit transactions were reversed.
B2C2’s contention is that Quoine had no contractual right to unilaterally cancel the trades once the orders were effected. They claimed that such a reversal was in breach of the Terms and Conditions. B2C2 also claimed that since Quoine holds the proceeds of B2C2’s account on trust for B2C2, unilateral withdrawal of the credited BTC constituted breach of trust.
There are two types; market makers and investor-traders.
Investor-traders buy and hold with a view to selling for a profit; market makers quote buy and sell orders on a given platform and try to capture the “bid-ask spread”. B2C2 is a market maker. They trade over multiple platforms through sophisticated algorithmic trading software. The software will monitor their position over all platforms and make adjustments to regulate the trader’s exposure for a given currency.
Market-makers can also be investor-traders. B2C2’s market-making role is more relevant. Quoine was operating as a market-maker on their own platform.
There are two types of orders relevant: market orders and limit orders.
Market orders: order to be executed immediately at the best available price.
Limit orders: order to be executed only when the desired price is available.
B2C2 was a market-maker in quoting limit orders in both directions and generating income by capturing a bid-ask spread (Mr. Maxime Boonen’s AEIC).
AGREEMENT AND RISK DISCLOSURE NOTICE
Last updated April 2014. The most important of the terms and conditions (“Agreement”) is as follows:
“Furthermore, once an order is filled, you are notified via the Platform and such an action is irreversible.”
The Risk Disclosure Statement was uploaded 22 March 2017 and features in one of Quoine’s defences.
19 April 2017: two margin traders (Pulsar and Mr. Tomita) were trading in ETH/BTC using ETH borrowed from Quoine. Their collateral had fallen below maintenance margins. The Platform automatically arranged to sell their assets at the best available prices to repay the ETH loans. Some of those orders were met by limit orders by B2C2 at 10 BTC to 1 ETH.
There was zero human intervention. This was all done by computers acting under their respective programs.
20 April 2017: Quoine reversed the orders.
FINDINGS OF FACT
THE QUOTER PROGRAM
13 April 2017: changes made to login passwords for several critical systems on the Platform, but certain necessary changes to the Quoter Program were not implemented.
The Quoter Program retrieves external market prices from other exchanges and creates new orders to be placed by Quoine on the Platform for market-making and liquidity generating purposes. This Program is not available to other users of the Platform.
The oversight meant the Program could not access data from the other exchanges. It became inoperative and stopped creating new ETH/BTC orders, and also did not generate an exception message to alert Quoine to the oversight. Quoine was only made aware after 19 April.
PLATFORM AND MARGIN CALLS
Quoine was estimated to be responsible for around 98% of market making trades on its own Platform. When the Program became inoperative, there were still orders that remained available for trading. Between 13 and 19 April 2017, the trading volume on the ETH/BTC order book was low and was “abnormally thin” by 19 April.
This caused the program to detect that Pulsar’s and Mr. Tomita’s accounts were in a “Margin Sell-Out Position”, triggering the margin calls that placed market orders to buy ETH at the best available market price. These market orders were placed despite the insufficient BTC balance in their accounts. This was accepted to be the result of poor design by Mr. Lozada.
When a margin call is made, the Platform purchased ETH at the lowest available price and worked through the existing orders in increasing value terms. It reached the orders at 10 and 9.9999 BTC per ETH from B2C2 and since there were no lower priced orders, these were filled to complete the Pulsar margin call.
B2C2 TRADING SOFTWARE
The abnormally thin order book also affected the B2C2 trading software.
This Software determines appropriate prices for Bid-Ask quotes via a “PureQuote Strategy”; it evaluates the first 20 price levels on any given platform from both Bid-Ask sides. It then excludes any price levels regarding low-volume orders.
To account for situations where there are too many low-volume orders or where the software just cannot determine a price, Mr. Boonen built in a failsafe so that the system would not stop working, since it was meant to work continuously without human oversight. This was the Deep Prices to both Bid-Ask sides. Therefore, even in such situations as described above, the software would not error out. The price set was 10 BTC/ETH at Ask and 0.00001 BTC/ETH at Bid. The prices had to be “sufficiently advantageous” so that B2C2 would not make a loss if orders were indeed filled at Deep Limit prices. This came into effect on 19 April when the order book thinned out.
There were allegations that these Deep Limit prices were set to take advantage of any perceived loss in the order book. The Judge was unpersuaded that it was the case.
MINDSET OF MR BOONEN
When there is a contractual issue between two computer systems acting as programmed but otherwise without human intervention, it is important to note the intentions of the programmer. The seven contracts on 19 April 2017 were made with zero human interaction.
The Judge found that Mr. Boonen intended for the Deep Prices to protect B2C2 against the risks of illiquidity, but he was not aware of the possibility of trades actually being executed at that level. He merely intended for B2C2 to make a profit if the unlikely became the reality. The programming was opportunistic but not sinister.
More than one contractual relationship will exist when trading on a currency platform.
- Traders and platform operators (“platform contracts”)
- Borrowers and lenders in margin trading (“margin contracts”)
- Buyer and seller when a trade is executed (“trading contracts”)
The allegation of breach of contract is directed to the platform contracts.
CLAIMS OF BREACH OF CONTRACT AND BREACH OF TRUST
BREACH OF CONTRACT
The 7 trades were executed as a result of market orders by the Counterparties which were filled by the limit orders by B2C2 at the deep limit of 10 BTC/ETH. The proceeds were credited and debited respectively to their accounts. The parties were notified in the usual way. Since the Agreement provides that “once an order is filled…such an action is irreversible,” B2C2 contends that such a reversal was a breach of the express term. Unless Quoine succeeds on at least one of their defences this claim will succeed.
BREACH OF TRUST
Quoine argued that it did not hold assets “on trust” for any party. There was no provision in the Agreement and the assets deposited by customers, though managed separately from Quoine’s own assets, were not deposited in a separate account with a trust bank.
B2C2 argued that since customer funds were managed separately from Quoine’s own assets, this was evidence of intention to create a trust.
Both accepted that to create a trust, the following elements have to be present: certainty of intention, certainty of subject matter, certainty of objects. Cryptocurrencies are certain as subject matter. Though not legal tender in the strictest sense, it is intangible property that is an identifiable thing of value. It is definable, identifiable by third parties, capable in assumption by third parties, and have some degree of permanence of stability.
Certainty of objects requires for intended beneficiaries to be identifiable. This is done so by seeing the individual accounts of the customers.
On intention to create a trust, the judge found that since the assets as held separately as Member’s assets rather than Quoine’s trading assets, this means Quoine claimed no title to he assets and acknowledges it is holding them to the order of the Member. Thus this fulfilled intent to hold assets on trust. If Quoine was not entitled to reverse the trades, this reversal and hence unilateral removal is breach of trust.
A term can be implied in the contract to give “business efficacy” to the contract and give effect to the intentions of the parties.
Quoine accepted that a term cannot be implied into the contract if it contradicted an express term of the agreement.
Quoine relied on two implied terms:
- Quoine may reverse any trades executed at abnormal rate or price as a result of technical and/or system failure and/or error affecting the Platform
- Quoine may reverse any trades resulting from orders placed in breach of the 2014 Terms and Conditions, including trades resulting from orders amounting to “market manipulation and/or abuse”, and therefore “unauthorised use” of the Platform.
Applicable principles were laid down by the Court of Appeal in Sembcorp Marine Ltd v PPL Holdings Ltd  4 SLR 193.
- Implication of terms is “an exercise in filling the gaps of the contract”,
- It is only appropriate to imply terms in a scenario where both “parties did not contemplate the issue at all and so left a gap”,
- Business efficacy and officious bystander tests remain the prevalent approach for implication of terms,
- The business efficacy basis is favoured in the commercial context,
- Threshold for implication is necessarily a high one.
- There is a three-step process to consider implication of terms.
- Ascertain how the gap in the contract arises
- Is it necessary to imply a term to give a contract business efficacy?
- Consider the specific term to be implied; the one which parties would have responded “Oh, of course!” if the term was put to them at the time of the contract.
B2C2 argues that implication of a term contradicts the express term of “…once an order is filled…such an action is irreversible.”
Judge found that it is not necessary for the terms to be implied to give business efficacy. The clause that provides for irreversibility introduces certainty and places the risk of entering any trade on parties to that trade. There is no need to imply the terms to give business efficacy.
EXPRESS TERMS READ WITH RISK DISCLOSURE STATEMENT
Clause (h) of the Agreement permits Quoine to alter the Agreement without notice but it is unclear how precisely it should be done.
Quoine argued that the Risk Disclosure Statement uploaded 22 March 2017 had the effect of introducing an new term into the Agreement permitting the Defendant to cancel transactions if it took place at an “aberrant value”.
B2C2 argued that the Risk Disclosure Statement and Agreement were accessible via different links and could not be read together; no other indication on the website that the Risk Disclosure Statement contained additional terms of the Agreement. They also argued that the Risk Disclosure Statement was a mere summary of risks and was not reasonably expected to a contractual agreement. The aberrant value clause was vague and imprecise; failed to constitute a contractual term.
The Judge found that unilateral variation of terms of contract were lawful but the other party must be notified of such a change. He also accepted that it is legally permissible for a term of a contract to be contained in another document which is not itself a document having contractual effect.
He further found that in uploading the Risk Disclosure Statement, there was no evidence that Members were informed about changes. A reasonable person would also not have any reason to believe the Risk Disclosure Statement would have amendments to the terms and conditions. It would therefore not have served to amend the agreement.
UNILATERAL MISTAKE AT COMMON LAW
An alternative argument assuming there was a breach of contract: asserting that there was a unilateral mistake at common law and in equity.
Case of Chwee Kin Keong and others v Digilandmall.com Pte Ltd  1 SLR(R) 502: in a unilateral mistake, only one of the parties makes a mistake and the other party knows of this mistake. The mistake has to be sufficiently important or fundamental. The Court can also find that actual knowledge of the error exists if upon the circumstances the Court thinks that the non-mistaken party is probably aware.
The Defendant must show that there is a:
- Sufficiently important or fundamental mistake
- The Plaintiff must have actual knowledge of the mistake.
Applying law to a case involving algorithmic trading raises the following questions:
- What mistakes have been made and how fundamental are they?
- How does one assess knowledge if the whole operation is carried out by programmed computers?
- Whose knowledge is relevant?
- What date is this knowledge to be assessed?
Quoine: the law should treat the algorithms or computers as legal agents of their human principles, relying on two learned articles. As a result, the Court should consider the knowledge and/or intention of the programmer of the software in question.
B2C2: there must be a mistake to the terms of contract; the party placing the order is mistaken. The only relevant knowledge is knowledge at the time of contracting.
Judge found that all parties were aware of the fully automated nature of such trades and it is artificial to adopt the scenario of a virtual meeting “on the floor of the exchange”. Judge also rejected B2C2’s argument that the only relevant knowledge is that of the time of contracting, agreeing with Quoine. The person in question is Mr. Boonen.
If these errors or omissions has not occurred, Quoine would have, or would very likely have, avoided any liability.
- Quoine could have included a specific clause in the Agreement entitling them to reverse abnormal trades.
- Failure to properly update the login credentials in the Quoter Program
- Failure to incorporate an exception message to alert Quoine to the fact that it was not working
- Failure to incorporate a circuit breaker in the Platform’s software to prevent trades when the order book was empty
- Failure to incorporate a circuit breaker to prevent orders at an abnormal price from being placed on the order book
- Failure to ensure that in the case of a force-closure, the forced sales were only within a given price range
- Failure to ensure that in the case of a force-closure, only assets actually held by a counterparty in its account at the time were the subject of a market order
The Judge eventually decided that Mr. Boonen did not insert the Deep Prices with the mistaken belief that no trader would trade at that price otherwise by way of mistake. He did not possess the actual knowledge to establish a mistake.
UNILATERAL MISTAKE IN EQUITY
Quoine needs to prove that even if Mr. Boonen did not have actual knowledge, he had constructive knowledge; that he should have known about the mistaken belief. There must also be impropriety.
Judge is satisfied that Mr. Boonen was rational and did not turn a blind eye to what would have been obvious. He has no actual and constructive knowledge
There was also no impropriety; the impropriety must lie in “unconscionable conduct or sharp practice”; carelessness does not entitle one to relief. The Deep Prices were opportunistic, but not sinister.
MUTUAL MISTAKE AT COMMON LAW
Cases referred: Court of Appeal in Olivine Capital Pte Ltd v Chia Chin Yan  2 SLR 1371 and the English High Court in Triple Seven MSN 27251 Ltd v Azman Air Services Ltd  EWHC 1348.
Four requirements have to be met:
- There must be a common assumption shared by both parties as to a particular state of affairs
- That assumption must be fundamental to the performance of the contract
- The assumption must have been wrong
- Performance of the contract must either be impossible or be radically different to what was contemplated
Quoine: ask the “meeting on the floor of the exchange” question; rejected by the Judge. Also submitted that there was a wrongful assumption that i) the platform was working correctly, ii) the trades were transacted at normal market conditions.
Mr. Boonen did not hold the mistaken belief as to price. Furthermore the “meeting on the floor” argument fails and if defence of unilateral mistake fails, so does the defence of mutual mistake.
Doctrine of unjust enrichment provides for one party against another who has received a benefit from the first party in unjust circumstances.
Case of Singapore Swimming Club v Koh Sin Chong Freddie  3 SR 845 at : 1) there must have been a benefit received by or which accrued to the second party, 2) the benefit of enrichment must be at the expense of the first party, 3) that enrichment must be unjust.
Judge finds that technically this is an action for the Counterparties, not Quoine. First two requirements are satisfied in this case. Sole issue is whether it would be unjust in the circumstances of this case for B2C2 to retain the proceeds.
Decision of the Court of Appeal in Wee Chiaw Sek Anna v Ng Li-Ann Genevieve (sole executrix of the estate of Ng Hock Seng, deceased)  3 SLR 801: unjust factors involve mistake, duress, undue influence, exploitation of weakness, human incapacity, failure of consideration, ignorance, legal compulsion, necessity, illegality and public authority ultra vires exaction and payment.
Quoine maintains the unjust factors are mistake and lack of consent due to ignorance. The circumstances in which the trades were executed are a result of the automated actions which would not have occurred if the Quoter Program was working properly.
The mistakes relied on are the same as that of the unilateral mistake: 1) the necessity of the margin call (rejected), 2) the “world-wide price” (rejected as an honestly held but mistaken belief).
The benefit was also conferred upon B2C2 without the consent of the Counterparties; they did not have sufficient BTC in their accounts; held by the Judge to be an irrelevant mistake.
The Judge accepted that it is only in exceptional circumstances that a claim for unjust enrichment can succeed where a contract has been held valid. B2C2 was enriched because Quoine failed to take any of the steps necessary to protect itself or the margin traders; the Counterparties did not take sufficient steps to ensure their beliefs were correct. The defence of unjust enrichment therefore fails.
The action therefore succeeds in both breach of contract and breach of trust.
III. RELIEF IF QUOINE IS LIABLE
B2C2 asked for specific performances coupled with additional damages. Considerations regard whether damages would be adequate and whether the person against whom the relief is sought would face substantial hardship: Lee Chee Wei v Tan Hor Peow Victor and others  3 SLR(R) 537 at , and Lim Beng Cheng v Lim Ngee Sing  1 SLR 524 at .
Specific performance means Quoine would have to transfer BTC to B2C2 that would have to be obtained at significantly higher prices compared to that of April 2017.
Declined to order specific performance and instead left B2C2 to claim for damages in both breach of contract and breach of trust; to be agreed and if not, to be assessed at a subsequent hearing.