Search code examples
javaandroidiosfix-protocol

Get data from FIX protocol in mobile apps


I need to create an app which get's it's displayed data from FIX protocol in real time.

How would be best practice to accomplish this?

  • Should the mobile app read directly the FIX data?
  • Should I put a server in between to transform the FIX data to JSON or something more prepared for service consumption? And if so... how would I do it to not lose the real time? Creating a websocket in Java which for the mobile apps to call and that websocket would transform the FIX data to JSON that way?

I never worked with the FIX protocol before by the way.


Solution

  • So like, the question is, can you put a FIX client on a mobile phone? I guess you can, and I am sure it will happen soon.

    Yes, anything can read FIX data, it's simply text stream name value pairs, where the name is a numbered tag to identify some particular financial data or process, as agreed between the FIX community as a whole, or between direct counterparties using messaging data dictionaries.

    These days you could try using SBE throughout, including at the mobile client, but for now current practise is yes, to use JSON for client endpoints (where the JSON name is not a FIX tag but the underlying FIX field name so it's easier for people to understand) and pass JSON messages to the mobile device in some kind of REST data processing.

    So yeah, you'd have a FIX server (if you are new to FIX try QuickFix) to connect with your provider. Then what you need between that server and mobile clients is asynchronous messaging. Consider a quote request is not a simple request / response where you can block the request thread until a single response is received, it's a request followed by a stream of many responses. So you want an event handler style to route the responses back to clients asynchronously. With many mobile UI clients making requests and receiving responses you need to demultiplex the responses from the 1 FIX server out to the many mobile clients. That's something that QuickFIX itself kind of already does using a session layer. You need to do the same using sessions or identifiers in the messages you're passing around.

    Yeah I guess websockets are intended to be that solution for real time. You could write a native mobile app though, using something like node or react to handle the message events.