egze
How would you architecture a trading phoenix application?
Hi,
I’m learning Phoenix and as a learning project for me - I’d like to build a simple bitcoin trading app. I’ve built something similar in Ruby before, and want to reimplement and improve it in Elixir.
Here is a plan how I would build it, please add your thoughts what you would do differently.
General idea what I want:
I’m thinking the system will have user registration where you can add your Bitstamp API key. Then you can pick different trading strategies and select how much funds you dedicate to each strategy. Then the system would execute the strategy when the conditions are met. Strategies will be fixed, and not some kind of user input with some DSL.
Implementation:
Use postgres to store users, funds for each strategy.
- Build user registration and settings for strategies.
- Get live price data with a Genserver process, use WebSockex for it.
- One trader Genserver process with multiple workers (1 worker per user - strategy?). It receives price data from the WebSockex process, and sends it to the worker.
- Worker executes the strategy with the current price, available funds, etc. Then either the order on the exchange is created or not.
- Make some email notifications that a trade happened.
What do you guys think? Does it sound like a good architecture for my idea?
First Post!
OvermindDL1
Seems good, although do you need multiple workers to receive and process price data, is it that common of a task? A pool of workers is always the safer bet though so it’s good. ![]()
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









