From 637c6db37fd6ccac756e81875ec81113324ddb04 Mon Sep 17 00:00:00 2001 From: CryptoKage2306 <26vivek06@gmail.com> Date: Sun, 22 Sep 2024 01:11:49 +0530 Subject: [PATCH] update --- bindings/src/querier.rs | 2 ++ bindings/src/query_resp.rs | 4 ++++ .../src/action/execute/create_perpetual_order.rs | 10 ++-------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bindings/src/querier.rs b/bindings/src/querier.rs index 11ee24ae..1d0305e3 100644 --- a/bindings/src/querier.rs +++ b/bindings/src/querier.rs @@ -193,6 +193,8 @@ impl<'a> ElysQuerier<'a> { .map_or(SignedDecimal::zero(), |funding_rate| funding_rate), price_impact: SignedDecimal::from_str(&raw_resp.price_impact) .map_or(SignedDecimal::zero(), |price_impact| price_impact), + borrow_fee: raw_resp.borrow_fee, + funding_fee: raw_resp.funding_fee, }; Ok(resp) diff --git a/bindings/src/query_resp.rs b/bindings/src/query_resp.rs index 855a352c..5d22e644 100644 --- a/bindings/src/query_resp.rs +++ b/bindings/src/query_resp.rs @@ -123,6 +123,8 @@ pub struct PerpetualOpenEstimationRawResponse { pub borrow_interest_rate: String, pub funding_rate: String, pub price_impact: String, + pub borrow_fee: Coin, + pub funding_fee: Coin, } #[cw_serde] @@ -147,6 +149,8 @@ pub struct PerpetualOpenEstimationResponse { pub borrow_interest_rate: SignedDecimal, pub funding_rate: SignedDecimal, pub price_impact: SignedDecimal, + pub borrow_fee: Coin, + pub funding_fee: Coin, } #[cw_serde] diff --git a/contracts/trade-shield-contract/src/action/execute/create_perpetual_order.rs b/contracts/trade-shield-contract/src/action/execute/create_perpetual_order.rs index 8b2174c3..364fdf3a 100644 --- a/contracts/trade-shield-contract/src/action/execute/create_perpetual_order.rs +++ b/contracts/trade-shield-contract/src/action/execute/create_perpetual_order.rs @@ -194,17 +194,11 @@ fn create_perpetual_open_order( open_estimation.liquidation_price, Fee { percent: open_estimation.borrow_interest_rate.to_string(), - amount: Coin { - denom: open_estimation.collateral.denom, - amount: todo!(), - }, + amount: open_estimation.borrow_fee, }, Fee { percent: open_estimation.funding_rate.to_string(), - amount: Coin { - denom: open_estimation.trading_asset, - amount: todo!(), - }, + amount: open_estimation.funding_fee, }, )?;