Serverless Contract Notes Solution built using AWS Lambda

The Challenge

A contract note is the legal record of any transaction carried out in a stock exchange through a stock broker. It serves as the confirmation of trade done on a particular day on behalf of a client on a stock exchange (BSE/NSE). Our customer stored all trade information of its clients on its on-premise Database MSSQL. At the end of day, they would download the entire trade information, process it and send the consolidated report to all its clients. But this activity used to take a minimum of 4-5 hours for completion. Also, the consolidated pdf generated was not as per the user experience guideline and the computation was not consistent.

The Solution

ACC developed a serverless solution to solve this problem. JAVA LAMBDA were written which were invoked on S3 Put Event. This solution has reduced the process time from 4 hours to 10 min. In 10 minutes, more than 5 lakh contracts were processed, reports were generated and emailed to end users. This solution also sends SMS notifications with short URLs to download the respective reports.

The serverless solution for contract notes supports all three trading hours – Derivatives, Currency and Commodity. The four major components of the solution are:

  1. Post market hours, daily files are transferred via SFTP to S3 Bucket
  2. On S3 Put event a LAMBDA function is triggered which processes the data and generates PDFs for contract notes and trade summary. These pdf files are sent to clients on a daily basis via email & SMS.
  3. While these PDFs are getting processed, they also get digitally signed using the PFX file provided by the customer.
  4. An API for reports is provided to business/development teams, to extract daily/weekly/monthly reports in CSV/JSON format.