From 723f1924ead046ac155464586ac3ad5952f42018 Mon Sep 17 00:00:00 2001 From: Kinrezc Date: Tue, 10 Oct 2023 15:43:00 -0400 Subject: [PATCH] add liquidity provider agent --- box-simulation/src/agents/liquidity_provider.rs | 0 box-simulation/src/agents/rebalancer.rs | 9 ++++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 box-simulation/src/agents/liquidity_provider.rs diff --git a/box-simulation/src/agents/liquidity_provider.rs b/box-simulation/src/agents/liquidity_provider.rs new file mode 100644 index 000000000..e69de29bb diff --git a/box-simulation/src/agents/rebalancer.rs b/box-simulation/src/agents/rebalancer.rs index c764455b5..0ce68be69 100644 --- a/box-simulation/src/agents/rebalancer.rs +++ b/box-simulation/src/agents/rebalancer.rs @@ -1,10 +1,12 @@ use box_core::math::ComputeReturns; use ethers::utils::format_ether; use std::ops::Div; +use std::sync::Arc; use super::*; pub struct Rebalancer { + pub client: Arc, pub lex: LiquidExchange, pub g3m: G3M, pub next_update_timestamp: u64, @@ -28,6 +30,7 @@ impl Rebalancer { let g3m = G3M::new(exchange_address, client.clone()); Ok(Self { + client, lex, g3m, target_volatility, @@ -67,7 +70,7 @@ impl Rebalancer { Ok(()) } - pub fn calculate_rv(&mut self) -> Result<()> { + fn calculate_rv(&mut self) -> Result<()> { // if self.asset_prices.len() > 15 then only calcualte for the last 15 elements if self.asset_prices.len() > 15 { let asset_rv = self @@ -112,4 +115,8 @@ impl Rebalancer { Ok(()) } + + fn execute_smooth_rebalance(&mut self) -> Result<()> { + Ok(()) + } }