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.
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?