Updated OrderForm construction for Bitfinex following updates on lib
This commit is contained in:
parent
5e39f2767f
commit
f31c778d66
@ -318,7 +318,6 @@ impl Connector for BitfinexConnector {
|
||||
let amount = order.amount();
|
||||
|
||||
let order_form = {
|
||||
let pre_leverage = {
|
||||
match order.kind() {
|
||||
OrderKind::Limit { price } => {
|
||||
bitfinex::orders::OrderForm::new(symbol_name, price, amount, order.into())
|
||||
@ -331,11 +330,11 @@ impl Connector for BitfinexConnector {
|
||||
}
|
||||
OrderKind::StopLimit { stop_price: price, limit_price } => {
|
||||
bitfinex::orders::OrderForm::new(symbol_name, price, amount, order.into())
|
||||
.with_price_aux_limit(limit_price)?
|
||||
.with_price_aux_limit(Some(limit_price))?
|
||||
}
|
||||
OrderKind::TrailingStop { distance } => {
|
||||
bitfinex::orders::OrderForm::new(symbol_name, 0.0, amount, order.into())
|
||||
.with_price_trailing(distance)?
|
||||
.with_price_trailing(Some(distance))?
|
||||
}
|
||||
OrderKind::FillOrKill { price } => {
|
||||
bitfinex::orders::OrderForm::new(symbol_name, price, amount, order.into())
|
||||
@ -344,18 +343,11 @@ impl Connector for BitfinexConnector {
|
||||
bitfinex::orders::OrderForm::new(symbol_name, price, amount, order.into())
|
||||
}
|
||||
}
|
||||
.with_meta(OrderMeta::new(
|
||||
.with_meta(Some(OrderMeta::new(
|
||||
BitfinexConnector::AFFILIATE_CODE.to_string(),
|
||||
))
|
||||
};
|
||||
|
||||
// adding leverage, if any
|
||||
match order.leverage() {
|
||||
// TODO: CHANGEME!!!!
|
||||
Some(_leverage) => pre_leverage.with_leverage(15),
|
||||
// Some(leverage) => pre_leverage.with_leverage(leverage.round() as u32),
|
||||
None => pre_leverage,
|
||||
}
|
||||
)))
|
||||
// TODO: CHANGEME!
|
||||
.with_leverage(Some(15))
|
||||
};
|
||||
|
||||
let response =
|
||||
|
Loading…
Reference in New Issue
Block a user