From 86905efea812f799d182f93d0ade9e1c0a0b3735 Mon Sep 17 00:00:00 2001 From: Alex Graham Date: Wed, 19 May 2021 10:30:34 -0400 Subject: [PATCH] Revert "change timeMatched in matching engine to match exberry" This reverts commit b7df78134e7409158ed21040924d716a2436796c. --- triggers/daml/MatchingEngine.daml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/triggers/daml/MatchingEngine.daml b/triggers/daml/MatchingEngine.daml index 885599b4..9a74dd33 100644 --- a/triggers/daml/MatchingEngine.daml +++ b/triggers/daml/MatchingEngine.daml @@ -6,8 +6,6 @@ module MatchingEngine where import DA.Finance.Types import DA.Action -import DA.Date -import DA.Time import DA.Foldable hiding (elem, null) import DA.Next.Set (fromList) import DA.List @@ -20,9 +18,6 @@ import Utils type CurrentOrderId = Int -getUnixTimestamp : TriggerA CurrentOrderId Int -getUnixTimestamp = convertRelTimeToMicroseconds . (flip subTime) (time (date 1970 Jan 1) 0 0 0) <$> getTime - handleMatching : Trigger CurrentOrderId handleMatching = Trigger { initialize = return 0 @@ -130,19 +125,19 @@ handleOrder party orders (orderCid, order) = do let fillQty = min passive.qty aggressive.qty fillPrice = passive.price - nanoTimestamp <- (* 1000) <$> getUnixTimestamp + time <- getTime emitExerciseCmd aggressiveCid Order_Fill with fillQty, fillPrice counterOrderId = passive.orderId counterParty = passive.exchParticipant - timeMatched = show nanoTimestamp + timeMatched = show time emitExerciseCmd passiveCid Order_Fill with fillQty, fillPrice counterOrderId = aggressive.orderId counterParty = aggressive.exchParticipant - timeMatched = show nanoTimestamp + timeMatched = show time return () @@ -197,7 +192,7 @@ handleClearedOrder party orders (orderCid, order) = do let fillQty = min passive.qty aggressive.qty fillPrice = passive.price - nanoTimestamp <- (* 1000) <$> getUnixTimestamp + time <- getTime emitExerciseCmd aggressiveCid ClearedOrder_Fill with fillQty, fillPrice @@ -215,7 +210,7 @@ handleClearedOrder party orders (orderCid, order) = do instrument = instrumentId exchange = party eventId = -1 - timeMatched = show nanoTimestamp + timeMatched = (show time) pair = order.pair trackingNumber = -1 buyer = buyer.exchParticipant