-
Notifications
You must be signed in to change notification settings - Fork 91
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
bigz/make-auction-start-baseline-more-passive #890
bigz/make-auction-start-baseline-more-passive #890
Conversation
perp_market.amm.last_bid_price_twap.cast::<i64>()? / price_divisor | ||
} | ||
PositionDirection::Short => { | ||
-(perp_market.amm.last_ask_price_twap.cast::<i64>()? / price_divisor) |
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.
should short start above oracle, why is this negative?
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.
this is only when *_twap_ts
has more than 60 second mismatch (cant be trusted to enforce optimistic starts), so the boundary is not strict at all
|
||
return Ok(match direction { | ||
PositionDirection::Long => { | ||
perp_market.amm.last_bid_price_twap.cast::<i64>()? / price_divisor |
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.
might be good to add comment that it's starting at bid (beneath oracle) intentionally to get a good price?
@@ -402,31 +429,27 @@ impl OrderParams { | |||
.last_oracle_price_twap_5min, | |||
)?; | |||
|
|||
let frac_of_long_spread_in_price: i64 = perp_market |
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 save some compute by doing the calculation in the match blocks
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 need both of them for both though
for the slow, i pushing it up slightly from the opposite side of the book
for the fast, im pulling it away from the mid
} | ||
PositionDirection::Long => baseline_start_price_offset_slow | ||
.safe_add(frac_of_long_spread_in_price)? | ||
.min(baseline_start_price_offset_fast.safe_sub(frac_of_short_spread_in_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.
so before we were doing max, which gives the more aggressive, now we're doing min, which is less aggresswive?
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.
correct, doing min for long is less aggressive
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #890 +/- ##
==========================================
+ Coverage 74.76% 74.80% +0.03%
==========================================
Files 130 130
Lines 30966 31046 +80
==========================================
+ Hits 23151 23223 +72
- Misses 7815 7823 +8
|
No description provided.