Quick Tips and Tricks: Production-grade Trade/Deal Capture in a day using functions as a service.

Quick Tips and Tricks

Scenario :

Complex deal type, contributing large positions to the commodity trading firm’s proprietary portfolio needed to be captured. ETRM system (CXL) support would take months. The opportunity was now.

Quick Tips and Tricks :

To support the business opportunity and capture deals, we used Factoryzetm Functions As a service deployed in a secure, datacenter deployed, bare metal, Kubernetes cluster to provide an enterprise-scale production-grade solution in three hours ( discovery, solution design to delivery into production).

The deal payload was packaged as a JSON string conforming to a JSON schema stored in an Apache Schema Registry. This JSON deal is sent to a function deployed using horizontal pod autoscaling to write to the Commodity Logictm database.

The function comprises a handler written in Python ( support for GO, Typescript, and several other languages) that validates and parses JSON payload. Then writes deal to MongoDB collection in the Commodity Logictm document database collection associated with deal type. Subsequently, a message is sent to Apache KAFKA topics, where Commodity Logictm consumers process the deal for risk, compliance, surveillance, positions, near real-time P&L, and other needs.

Quick Tips and Tricks : Send json with spaces using jo and curl on Mac

Quick Tips and Tricks

Scenario :

A developer wants to send json containing spaces in the values to a FAAS function. The payload for the function is a json with three name-value pairs : commodity, role_name and subsidiary_name. The values may contain spaces. This trick is one way to send to the function using curl from the command line. Prevents the curl function from failing to understand

Quick Tips and Tricks :

brew install jo
c="NG"
r="Settlements"
s="ABC, LLC"
apiurl="http://localhost/function/somefunction"
curldata=$(jo commodity="$c" role_name="$r" subsidiary_name="$s")
curl -d "$curldata" "$apiurl"

%d