Re-design usage of quotes / prices #1108
Replies: 2 comments 4 replies
-
Thanks for writing this up. I agree with (1). On
In my eyes there are two ways how a position can be closed:
Let's focus only on (1) for now, which is what we have at the moment and leave (2) for the future. Our collaborative settlement can be seen as closing with a market order as the user is not asked for any input. The important thing here is that the unrealized P/L as shown in the UI is not equal to what he would get. It's an estimate if the position was to closed at the current price. For me this would mean two things:
Ideally, a maker comes up with the price but that's a bit challenging because for us the maker we market sell to is always the same we opened the position with in the first place. |
Beta Was this translation helpful? Give feedback.
-
Proposal from @bonomat in #1290: Atm: The bitmex price feed is used for the maker to come up with a rate when creating offers and for maker and taker for computing P/L. A few thoughts:
We want to show a P/L to the taker though: we have already two price feeds for the taker:
--> For the taker's unrealized P/L we probably should make use the maker's offers as this is what he would get when settling a position. Given that we can remove the bitmex price feed altogether. Note: For a precise P/L computation we should know the payout curve, meaning, if we want to compute P/L from the outside, we will need to expose this information via the HTTP Api. |
Beta Was this translation helpful? Give feedback.
-
Currently, we subscribe to BitMex for quotes.
The latest quote is used for:
(1) is problematic because when to trigger a a new offer is external to the maker binary and influenced by several things including a significant change in the current price. It would be a lot more natural to have the actual price of the offer also be external to the maker binary.
(2) is just wrong, we should use the index price for this.
(3) is tricky. We don't want to put this on the user and offer them an input field.
Would it be correct to suggest settling based on the current index price @bonomat @da-kami @itchymax @scratchscratchscratchy?
If yes, then we could do the following:
new offer
endpoint to require a price (and remove the price subscription entirely from the maker).1Footnotes
This implies that we are no longer doing any P/L calculation for the maker which is currently happening within
crate::projection
and used by both parties. For now, we can just permanently passNone
here for the maker but in the long run, these models should likely just separate and we need to projection modules, one for each binary. ↩Beta Was this translation helpful? Give feedback.
All reactions