Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

feat: Add missing pools #432

Merged
merged 6 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions bindings/src/query_resp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ pub struct LeveragelpParamsResponse {
}

#[cw_serde]
pub struct LeveragelpPosition {
pub struct Position {
pub address: String,
pub collateral: Coin,
pub liabilities: Int128,
Expand All @@ -621,6 +621,13 @@ pub struct LeveragelpPosition {
pub amm_pool_id: u64,
pub stop_loss_price: Decimal,
}
#[cw_serde]
pub struct LeveragelpPosition {
pub position: Position,
pub interest_rate_hour: Decimal,
pub interest_rate_hour_usd: Decimal,
}


#[cw_serde]
pub struct LeveragelpPositionResponse {
Expand All @@ -639,7 +646,7 @@ impl LeveragelpPositionsResponseRaw {
.clone()
.unwrap_or(vec![])
.iter()
.map(|x| x.id)
.map(|x| x.position.id)
.collect()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use elys_bindings::query_resp::LeveragelpPosition;
use elys_bindings::query_resp::LeveragelpPositionsResponse;
use elys_bindings::query_resp::MasterchefUserPendingRewardData;
use elys_bindings::query_resp::MasterchefUserPendingRewardResponse;
use elys_bindings::query_resp::Position;
use elys_bindings::query_resp::Validator;
use elys_bindings::trade_shield::msg::ExecuteMsg;
use elys_bindings::types::PageResponse;
Expand Down Expand Up @@ -122,19 +123,23 @@ impl Module for ElysModuleWrapper {
}
ElysQuery::LeveragelpQueryPositionsForAddress { .. } => {
let position = LeveragelpPosition {
address: "user".to_string(),
collateral: Coin {
denom: "uelys".to_string(),
amount: Uint128::new(100000000),
position: Position {
address: "user".to_string(),
collateral: Coin {
denom: "uelys".to_string(),
amount: Uint128::new(100000000),
},
liabilities: Int128::zero(),
interest_paid: Int128::zero(),
leverage: Decimal::new(Uint128::new(10)),
leveraged_lp_amount: Int128::new(10000000),
position_health: Decimal::one(),
id: 1,
amm_pool_id: 1,
stop_loss_price: Decimal::one(),
},
liabilities: Int128::zero(),
interest_paid: Int128::zero(),
leverage: Decimal::new(Uint128::new(10)),
leveraged_lp_amount: Int128::new(10000000),
position_health: Decimal::one(),
id: 1,
amm_pool_id: 1,
stop_loss_price: Decimal::one(),
interest_rate_hour: Decimal::one(),
cryptokage1996 marked this conversation as resolved.
Show resolved Hide resolved
interest_rate_hour_usd: Decimal::zero(),
};

let resp = LeveragelpPositionsResponse {
Expand Down
Loading