Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 86905ef

Browse files
committed
Revert "change timeMatched in matching engine to match exberry"
This reverts commit b7df781.
1 parent b7df781 commit 86905ef

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

triggers/daml/MatchingEngine.daml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ module MatchingEngine where
66
import DA.Finance.Types
77

88
import DA.Action
9-
import DA.Date
10-
import DA.Time
119
import DA.Foldable hiding (elem, null)
1210
import DA.Next.Set (fromList)
1311
import DA.List
@@ -20,9 +18,6 @@ import Utils
2018

2119
type CurrentOrderId = Int
2220

23-
getUnixTimestamp : TriggerA CurrentOrderId Int
24-
getUnixTimestamp = convertRelTimeToMicroseconds . (flip subTime) (time (date 1970 Jan 1) 0 0 0) <$> getTime
25-
2621
handleMatching : Trigger CurrentOrderId
2722
handleMatching = Trigger
2823
{ initialize = return 0
@@ -130,19 +125,19 @@ handleOrder party orders (orderCid, order) = do
130125
let fillQty = min passive.qty aggressive.qty
131126
fillPrice = passive.price
132127

133-
nanoTimestamp <- (* 1000) <$> getUnixTimestamp
128+
time <- getTime
134129

135130
emitExerciseCmd aggressiveCid Order_Fill with
136131
fillQty, fillPrice
137132
counterOrderId = passive.orderId
138133
counterParty = passive.exchParticipant
139-
timeMatched = show nanoTimestamp
134+
timeMatched = show time
140135

141136
emitExerciseCmd passiveCid Order_Fill with
142137
fillQty, fillPrice
143138
counterOrderId = aggressive.orderId
144139
counterParty = aggressive.exchParticipant
145-
timeMatched = show nanoTimestamp
140+
timeMatched = show time
146141

147142
return ()
148143

@@ -197,7 +192,7 @@ handleClearedOrder party orders (orderCid, order) = do
197192
let fillQty = min passive.qty aggressive.qty
198193
fillPrice = passive.price
199194

200-
nanoTimestamp <- (* 1000) <$> getUnixTimestamp
195+
time <- getTime
201196

202197
emitExerciseCmd aggressiveCid ClearedOrder_Fill with
203198
fillQty, fillPrice
@@ -215,7 +210,7 @@ handleClearedOrder party orders (orderCid, order) = do
215210
instrument = instrumentId
216211
exchange = party
217212
eventId = -1
218-
timeMatched = show nanoTimestamp
213+
timeMatched = (show time)
219214
pair = order.pair
220215
trackingNumber = -1
221216
buyer = buyer.exchParticipant

0 commit comments

Comments
 (0)