-
-
Notifications
You must be signed in to change notification settings - Fork 346
FEATURE: [xmaker] support fiat synthetic hedge #2051
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
Conversation
def3b45
to
55dda8f
Compare
55dda8f
to
90bd98c
Compare
1643f61
to
aac0464
Compare
7cb8f17
to
f400740
Compare
"github.com/c9s/bbgo/pkg/types" | ||
) | ||
|
||
type PositionExposure struct { |
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.
can be pulled out to the core types package
|
||
func (m *PositionExposure) Close(delta fixedpoint.Value) { | ||
m.pending.Add(delta) | ||
m.net.Add(delta) |
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.
How about use Sub ? I find it use Close(Number(-1)) in the test function, but somehow it confused me at the first time.
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.
Open() and Close() are paired
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.
because it's "open position" and "close position"
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.
I think the process for xmaker is Open -> Cover -> Close
Currently the flow will be the following
- maker market receive BUY 1 TRADE -> Open(1)
- hedge market place SELL 1 ORDER -> Cover(1)
- hedge market receive SELL 1 TRADE -> Close(-1)
Both 2 and 3 are SELL side in the hedge market, but the delta are different (1 and -1). Somehow, it confuse me.
FEATURE: [xmaker] implement trade conversion for synthetic hedging
No description provided.