API to manage and track trades, portfolio and returns.
- FolioTrack can be used to record trades and maintain personal portfolio.
- It is intended to be an exploratory learning project to understand the nuances and edge cases of a financial-securities related product.
- Create trades by providing a price, action (BUY or SELL), quantity, and ticker symbol of the security.
- Fetch all trades for corresponding securities.
- Modify trade parameters like price, action or quantity.
- Cancel trades, which will not delete them but mark them an not active.
- Fetch a portfolio summary that returns net quantity and average price for all securities held.
- Fetch returns for the portfolio against current ticker price.
- Strict validation for final securities quantity to always be non-negative.
- Fetch Trades
- Endpoint -
/api/trade
- Method -
GET
- Required parameters - None
- Fetch all Trades
- Optional parameters
?includeInactive=1
passing 1 as the request argument will include inactive trades in the response - i.e. trades that have been cancelled.
- Endpoint -
- Create / Add Trade
- Endpoint -
/api/trade
- Method -
POST
- Required Parameters (
application/json
)price
- Price at which the trade is to be considered executed. Type -float
action
- EitherBUY
orSELL
. Type -string
quantity
- Quantity of securities. Type -float
(consider crypto)ticker
- Ticker Symbol of the security. Type -string
- BUY 1000 $DOGEUSD @ 0.4 | SELL 10 $DOGEUSD @ 1.0
- Endpoint -
- Update / Modify Trade
- Endpoint -
/api/trade
- Method -
PATCH
- Required Parameters (
application/json
)tradeId
- Trade ID to be updated. Type -string
.fieldToUpdate
- Eitherprice
,quantity
oraction
. Type -string
updateValue
- The intended updated value. Type -string
(foraction
) andfloat
(forprice
andquantity
)- Sample API Calls
- Endpoint -
- Cancel / Remove Trade
- Endpoint -
/api/trade
- Method -
DELETE
- Required Parameters (
application/json
)tradeId
- Trade ID to be deleted. Type -string
- Cancel $DOGEUSD Sell Order
- Endpoint -
- Fetch Portfolio Summary
- Endpoint -
/api/portfolio
- Method -
GET
- Required Parameters - None
- Get Portfolio Summary
- Endpoint -
- Fetch Portfolio Returns
- Endpoint -
/api/returns
- Method -
GET
- Required Parameters - None
- Get Portfolio Returns
- Endpoint -
- Ping Endpoint
- Endpoint -
/ping
- Method -
ANY
- Required Parameters - None
- Send ping
- Endpoint -