We are a fintech company that runs a cryptocurrency hedge fund and are developing an exchange.
We are sub-contracting out small trader tools like this project that are independent of our main project.
We need a web app written in PhP that:
1. Calls Bitstamp's [A cryptocurrency exchange] REST API to check bid and ask prices.
2. Either an instant order [If the price difference between bid and ask prices < USD10] or a limit order is placed via the API based on the prices. Limit order will be priced at the mid point between bid and ask prices [bid + ([bid - ask]/2)]
3. If a limit order is placed, a timer is set to check if it executes.
4. If it hasn't executed, check if the bid price has gone above it or if the ask price as gone below it. If either one happens, cancel the order and make a new one.
2. If executed, check the balance and withdraw the purchased cryptocurrency to a wallet address of our choosing if balance is enough.
Attached is a simple flowchart of how it should work and the interface.
It is meant to be simple as it only involves placing either an instant or limit order to buy and then withdrawing it after the order has been executed. No other types of orders like sell orders.