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

Post new orders to Bitmex #974

Closed
Tracked by #972
bonomat opened this issue Jul 12, 2023 · 4 comments · Fixed by #1095
Closed
Tracked by #972

Post new orders to Bitmex #974

bonomat opened this issue Jul 12, 2023 · 4 comments · Fixed by #1095
Assignees
Labels
Milestone

Comments

@bonomat
Copy link
Contributor

bonomat commented Jul 12, 2023

After a position has been opened.

  • We can not replicate a single trade as it is too small. min 100$ on Bitmex.

Trading Strategy Proposal:

  • Upon a change in the trading volume update the position on bitmex accordingly.

e.g. The following query gives all open positions which haven't expired yet. Note, that expired positions although not closed can be force closed at the price at expiry. So we can look at them as being closed at the price at expiry.

select direction, sum(quantity), sum(collateral) from positions where expiry_timestamp >= NOW() and position_state='Open' group by direction;

hint: get inspired by https://github.com/get10101/automaker

@bonomat bonomat mentioned this issue Jul 21, 2023
@holzeis holzeis transferred this issue from another repository Jul 21, 2023
@holzeis holzeis transferred this issue from another repository Jul 21, 2023
@da-kami
Copy link
Contributor

da-kami commented Jul 28, 2023

I assume that the BitMEX position will be posted by the maker not the coordinator.
As captured in #973 I assume that the maker is not concerned about any DLCs just yet, but is just notified by the coordinator about order matches and trade execution success.

That said, I don't think it makes much sense to have multiple "positions" for the same trading pair on the maker. I think the maker should just have a combined position - and if said position reaches enough volume to be hedged on BitMEX then we hedge it. In case the position of the maker falls below 100 again we just stop hedging on BitMEX again.

CC @holzeis (the description adder)

@bonomat
Copy link
Contributor Author

bonomat commented Jul 30, 2023

I agree, the maker should have a single - combined position. This simplifies the hedging strategy enormously.

@bonomat bonomat added the maker label Jul 30, 2023
@luckysori
Copy link
Contributor

Note, that expired positions although not closed can be force closed at the price at expiry. So we can look at them as being closed at the price at expiry.

I guess with this you mean that we can just treat them as realised PNL. No need to hedge based on them.

@bonomat
Copy link
Contributor Author

bonomat commented Jul 31, 2023

I guess with this you mean that we can just treat them as realised PNL. No need to hedge based on them.

Yes. That is what I meant :)

@bonomat bonomat added this to the 1.3.0 milestone Aug 7, 2023
@bonomat bonomat self-assigned this Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants