-
Notifications
You must be signed in to change notification settings - Fork 84
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
(feat) Batch order placing for Injective #305
(feat) Batch order placing for Injective #305
Conversation
@CoinAlpha/qa-team, @CrimsonJacket, @aarmoa I have opened this PR for review by the developers. Since we still don't have a confirmed-stable version for the base PR, then this PR cannot yet be QA-tested. |
gateway/src/clob/clob.requests.ts
Outdated
export interface ClobDeleteOrderRequestExtract { | ||
market: string; | ||
orderId: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for this naming convention over using CancelOrderParam
like what we have for CreateOrderParam
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No much reason. That could also work. Just trying to keep reference to ClobDeleteOrderRequest
so it can be obvious that it's peculiar to CLOB.
for order in orders_to_create: | ||
if order.is_buy: | ||
client_order_id = self.buy( | ||
trading_pair=order.trading_pair, | ||
amount=order.quantity, | ||
order_type=OrderType.LIMIT, | ||
price=order.price, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why the default behaviour for batch_order_create
is in contrast to what it is originally meant to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @CrimsonJacket . This is the default implementation we add in ConnectorBase to make all connectors polymorphic with the new functionality. But we are not providing now the logic to the the batch actions in all connectors, only for Injective. That is why the default behavior has to be doing the same thing we do when requested actions for a single order: handling them one by one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @CrimsonJacket . This is the default implementation we add in ConnectorBase to make all connectors polymorphic with the new functionality. But we are not providing now the logic to the the batch actions in all connectors, only for Injective. That is why the default behavior has to be doing the same thing we do when requested actions for a single order: handling them one by one.
Hello, I see you have been active in certain areas where we need some simple but urgent help. Can you please contact me on telegram @saveplanetearthdev , thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@petioptrv I have left some comments wrt the default behaviour of batch_order_create
and some minor comments on the naming convention of ClobDeleteOrderRequestExtract
. Personally I feel that batch_order_create
should, as its name suggest, should perform the same logic that is defined within GatewayCLOBSPOT.batch_order_create
and we should only really overwrite it when needed
…atch_update # Conflicts: # gateway/src/connectors/injective/injective.ts
This reverts commit 60683f6.
@CrimsonJacket, as Abel pointed out in his comment, we are only implementing the full functionality for Injective in this PR |
…ol_batch_update # Conflicts: # hummingbot/connector/gateway/clob_spot/data_sources/injective/injective_api_data_source.py
Closing to re-open towards foundation: hummingbot#6139 |
Before submitting this PR, please make sure:
A description of the changes proposed in the pull request:
This PR introduces batch order creation and cancelation for the client.
The functionality is implemented with backward compatibility.
The Injective connector is refactored to provide this enhanced order management.
Tests performed by the developer:
Added tests for the new functionality.
Tips for QA testing:
Please test that at least one spot and one perpetual exchanges work with a normal PMM strategy, as well as with the new
batch_order_update.py
script. Also, test Injective specifically with the new script. The script strategy has four phases:The script begins by setting some global variables
The
ORDERS_INTERVAL
variable is the number of ticks (seconds) between each of the script phases. ThePRICE_OFFSET_RATIO
variable sets the orders' prices at 10% from the current mid-market price.Associated Gateway PR
CoinAlpha/gateway#4