diff --git a/rustybot/src/connectors.rs b/rustybot/src/connectors.rs
index cc60ea7..0bf4c7c 100644
--- a/rustybot/src/connectors.rs
+++ b/rustybot/src/connectors.rs
@@ -5,20 +5,23 @@ use std::sync::Arc;
use async_trait::async_trait;
use bitfinex::api::Bitfinex;
+use bitfinex::book::{Book, BookPrecision};
use bitfinex::orders::{CancelOrderForm, OrderMeta};
+use bitfinex::responses::{OrderResponse, TradeResponse};
use bitfinex::ticker::TradingPairTicker;
use futures_retry::{FutureRetry, RetryPolicy};
use log::trace;
use tokio::macros::support::Future;
use tokio::time::Duration;
+use tokio_tungstenite::stream::Stream::Plain;
use crate::currency::{Symbol, SymbolPair};
+use crate::models::TradingPlatform::Margin;
use crate::models::{
- ActiveOrder, OrderBook, OrderBookEntry, OrderForm, OrderKind, Position, PositionState,
- PriceTicker, TradingPlatform, WalletKind,
+ ActiveOrder, OrderBook, OrderBookEntry, OrderDetails, OrderFee, OrderForm, OrderKind, Position,
+ PositionState, PriceTicker, Trade, TradingPlatform, WalletKind,
};
use crate::BoxError;
-use bitfinex::responses::OrderResponse;
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
pub enum Exchange {
@@ -114,6 +117,20 @@ impl Client {
.transfer_between_wallets(from, to, symbol, amount)
.await
}
+
+ pub async fn trades_from_order(
+ &self,
+ order: &OrderDetails,
+ ) -> Result