Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crypto Simulate Transactions Endpoint #9

Open
theDe-bugger opened this issue Nov 17, 2023 · 0 comments
Open

Crypto Simulate Transactions Endpoint #9

theDe-bugger opened this issue Nov 17, 2023 · 0 comments
Assignees
Labels
arb Arbitrage Strat backend

Comments

@theDe-bugger
Copy link
Contributor

Description

We need an endpoint that allows us to simulate a list of transactions for a given crypto currency.

  • You may also make this as a function instead of an endpoint that the other endpoints can simply call to perform the calculations

Crypto Based Simulation Endpoint:

We need to make GET request!

Endpoint

'/api/cryptoarb/simulate'

Params

Return

  • optimize the capital to invest the money and make the most profit
  • ie; if it makes sense to invest a lot the first time and sell it all, do that. if it makes more profit to buy some at the start, sell half, and then buy a little more later, do that.
  • going to require some logic.
  • return total profit made and an updated list of transactions mentioning how much was sold/bought at each transaction

Example Call

GET /api/cryptoarb
with params:

  • currency symbol = BTC
  • exchange 1 = POLINIEX
  • exchange 2 = BINANCE
  • capital = 10000.00

Example Return

results :
{
'profit': 20000.00,
'transactions': {
'opportunity1' : {
'action1' : 'buy',
'timestart1': 'dd/mm/yyyy hh:mm:ss',
'timeend1': 'dd/mm/yyyy hh:mm:ss',
'amount1': 10000.00,
'action2': 'sell',
'timestart2': 'dd/mm/yyyy hh:mm:ss',
'timeend2': 'dd/mm/yyyy hh:mm:ss',
'amount2': 12000.00
},
'opportunity2' : {
'action1' : 'buy',
'timestart1': 'dd/mm/yyyy hh:mm:ss',
'timeend1': 'dd/mm/yyyy hh:mm:ss',
'amount1': 12000.00,
'action2': 'sell',
'timestart2': 'dd/mm/yyyy hh:mm:ss',
'timeend2': 'dd/mm/yyyy hh:mm:ss',
'amount2': 14000.00
}
}
.
.
.
}

Error Handling

For any error, just throw 400 for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arb Arbitrage Strat backend
Projects
None yet
Development

No branches or pull requests

2 participants