|
|
@@ -269,13 +269,13 @@ impl AvellanedaStoikov {
|
|
|
}
|
|
|
|
|
|
pub fn update_optimal_ask_and_bid(&mut self) {
|
|
|
- self.optimal_ask_price = if self.inventory < Decimal::ZERO {
|
|
|
+ self.optimal_ask_price = if self.inventory > Decimal::ZERO {
|
|
|
self.ref_price + self.ask_delta / Decimal::TWO
|
|
|
} else {
|
|
|
max(self.ref_price + self.ask_delta / Decimal::TWO, self.ask_price)
|
|
|
};
|
|
|
|
|
|
- self.optimal_bid_price = if self.inventory > Decimal::ZERO {
|
|
|
+ self.optimal_bid_price = if self.inventory < Decimal::ZERO {
|
|
|
self.ref_price + self.ask_delta / Decimal::TWO
|
|
|
} else {
|
|
|
min(self.ref_price - self.bid_delta / Decimal::TWO, self.bid_price)
|