KishoreKarunakaran

KishoreKarunakaran

Is Elixir with Phoenix a good choice for building real-time stock trading systems ?

Requirements are High Availability and Low Latency.

What are your thoughts about this ?

What will be pros and cons if one uses Elixir and Phoenix in real time trading systems ?

Showing Posts 1 to 10

AndyL

AndyL

IMO yes! It’s possible to treat offers as processes & index them to get really fast matching. Use commanded if you need event-sourcing for auditability.

jakemorrison

jakemorrison

It depends on your definition of real time. Erlang is quite popular in real time ad exchanges. Lack of garbage collection pauses give more predictable latency than some languages. It is considered “soft” real time, though.

When things need to be really fast and predictable, then C++ was popular, sometimes supervised by Erlang. That is a pretty good approach, isolating the pieces that need to be fast. Now speeds are such that things are done in silicon.

We wrote an embedded “logo inserter” box for the broadcast television industry in a mixture of Erlang and C++. The C++ handled the low level processing: pull a frame from a Blackmagic SDI interface, add an image, send it out another interface, 60 frames per second. Erlang handled everything else, and restarted the C++ if it should crash in time for the next frame. Bulletproof.

16
Post #2
KishoreKarunakaran

KishoreKarunakaran OP

Thanks @jakemorrison and @AndyL.

idi527

idi527

Does Elixir with Phoenix is good choice for real-time stock trading systems ?

Depends on what you mean by this. I’ve heard success stories with c++ and erlang (c++ handled computations, erlang handled some networking). And some experiments with erlang + rust (now rust handles the computations).

I don’t quite see how phoenix fits in a trading system, though.

dom

dom

Low latency can mean a second to some people, and a millisecond to others. What range do you have in mind?

KishoreKarunakaran

KishoreKarunakaran OP

@dom Trading system placing buy/sell equity or FX orders to the market will target a latency of under 20ms

dom

dom

That sounds quite doable. Keep in mind that Erlang is optimized for robustness above math performance, so it lacks things like native integers (it uses bignums) and can be slow. If your system is computation-heavy, managing big baskets, etc. that may be a worry. NIFs may help. For stuff like order routing and as a backend for user GUIs though it should be a nice platform to work on.

gonglexin

gonglexin

Take a look at https://chaince.com/, it’s a crypto exchange which written by Elixir.

KishoreKarunakaran

KishoreKarunakaran OP

@dom and @gonglexin Thanks for your feedback’s.

idi527

idi527

I would think that from the point of view of a market maker, a real exchange and a crypto exchange are very different beasts in terms of response time / performance requirements … I think even ads (see adroll) come closer to what’s required from a real time system than a crypto exchange due to the inherent limits of crypto trading (which seems to be mostly retail for now).

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews