Description
Need a backend endpoint that the site can access to test the crypto arbitrage strategies for a specific currency, two exchanges, and time frame.
Overall:
- Gurik made a function to take in a crypto currency, two exchanges, and a time frame and return a list of indentified opportunities for crypto arbitrage
- You need to discuss this with him and create a REST API that takes the specified parameters and returns the list as required
We need to make GET request!
Endpoint
'/api/cryptoarb'
Params
- currency symbol
- exchange 1
- exchange 2
- time frame (last month, last week, last day)
Return
- returns list of opportunities in the format shown in the example below
- action1 corresponds to what should be done on exchange 1
- action2 corresponds to what should be done on exchange 2
- the rest are intuitively similar
Example Call
GET /api/cryptoarb
with params:
- currency symbol = BTC
- exchange 1 = POLINIEX
- exchange 2 = BINANCE
- time frame = last day
Example Return
results :
{
'opportunity1' : {
'action1' : 'sell',
'timestart1': 'dd/mm/yyyy hh:mm:ss',
'timeend1': 'dd/mm/yyyy hh:mm:ss',
'action2': 'buy',
'timestart2': 'dd/mm/yyyy hh:mm:ss',
'timeend2': 'dd/mm/yyyy hh:mm:ss'
},
'opportunity2' : {
'action1' : 'sell',
'timestart1': 'dd/mm/yyyy hh:mm:ss',
'timeend1': 'dd/mm/yyyy hh:mm:ss',
'action2': 'buy',
'timestart2': 'dd/mm/yyyy hh:mm:ss',
'timeend2': 'dd/mm/yyyy hh:mm:ss'
},
.
.
.
}
Error Handling
For any error, just throw 400 for now
Description
Need a backend endpoint that the site can access to test the crypto arbitrage strategies for a specific currency, two exchanges, and time frame.
Overall:
We need to make GET request!
Endpoint
'/api/cryptoarb'
Params
Return
Example Call
GET /api/cryptoarb
with params:
Example Return
results :
{
'opportunity1' : {
'action1' : 'sell',
'timestart1': 'dd/mm/yyyy hh:mm:ss',
'timeend1': 'dd/mm/yyyy hh:mm:ss',
'action2': 'buy',
'timestart2': 'dd/mm/yyyy hh:mm:ss',
'timeend2': 'dd/mm/yyyy hh:mm:ss'
},
'opportunity2' : {
'action1' : 'sell',
'timestart1': 'dd/mm/yyyy hh:mm:ss',
'timeend1': 'dd/mm/yyyy hh:mm:ss',
'action2': 'buy',
'timestart2': 'dd/mm/yyyy hh:mm:ss',
'timeend2': 'dd/mm/yyyy hh:mm:ss'
},
.
.
.
}
Error Handling
For any error, just throw 400 for now