@@ -6,8 +6,6 @@ module MatchingEngine where
66import DA.Finance.Types
77
88import DA.Action
9- import DA.Date
10- import DA.Time
119import DA.Foldable hiding (elem, null)
1210import DA.Next.Set (fromList)
1311import DA.List
@@ -20,9 +18,6 @@ import Utils
2018
2119type CurrentOrderId = Int
2220
23- getUnixTimestamp : TriggerA CurrentOrderId Int
24- getUnixTimestamp = convertRelTimeToMicroseconds . (flip subTime) (time (date 1970 Jan 1) 0 0 0) <$> getTime
25-
2621handleMatching : Trigger CurrentOrderId
2722handleMatching = 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