Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Trade Reconciliation - Timestamps This question builds on the concepts in Trade Reconciliation - Parsing. Sometimes the timestamps regarding reconciliation are a bit imprecise.

image text in transcribedimage text in transcribed
2. Trade Reconciliation - Timestamps This question builds on the concepts in Trade Reconciliation - Parsing. Sometimes the timestamps regarding reconciliation are a bit imprecise. Akuna's trades are timestamped up to 5 minutes, inclusive, before or after the exchange. Given lines of comma-separated values representing trades from Akuna and one exchange EXCHANGE, complete the class below to process input; you can copy or modify code from your earlier work on Trade Reconciliation - Parsing. Then complete the method reconciliation, which will be run after all the input is processed. This method determines if there is a potential perfect reconciliation, which is defined as a one-to-one match of every trade from Akuna to the exchange and vice versa. Since there are no unique IDs on this data, some trades may potentially match to multiple other trades (e.g. AKUNA,A, 10, 11:59:00 could match to either EXCHANGE,A, 10, 11:54:00 or EXCHANGE,A, 10, 12 :04 :00), but a perfect reconciliation requires a one-to-one match on every trade with no breaks on either side. Return True if there is a potential perfect reconciliation, and False otherwise. Assume input values are not sorted on any fields, such as timestamp or source. Example 1 Input AKUNA,A,10,11:59:oo AKUNA,B,-15,12:05:oo \\ EXCHANGE,A,1@,12:@1:00 ,i EXCHANGE,B,-15,12:@9:00 _/,/\"\"\"i f" L x / Output: _ _ True Example 2 Input: AKUNA, A, 10, 11 : 01:00 AKUNA , A, 10, 11 : 02:00 AKUNA, A, 10, 11 : 03: 00 EXCHANGE , A, 10 , 11 : 04:00 EXCHANGE , A, 10, 11 : 02:00 EXCHANGE , A, 10, 11 : 03:00 Output: True Example 3 Input: EXCHANGE , A, 10, 11:59:00 AKUNA, A, 10 , 11 : 59:00 EXCHANGE , A, 10, 12: 00:00 EXCHANGE , B, 12 , 15: 01:03 EXCHANGE , H, -50, 16: 14:02 AKUNA, A, 10, 11 : 53:00 AKUNA , A, 10, 12: 00:00 EXCHANGE , A, 10, 12 : 01:00 AKUNA, B, 12, 15: 01: 02 AKUNA, H, -50, 16 : 19:02 Output: False - there is no match for the trade AKUNA, A, 10, 11 : 53: 00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions