use elys_std_deriv::CosmwasmExt;
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.LegacyParams")]
pub struct LegacyParams {
#[prost(string, tag = "1")]
pub leverage_max: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub borrow_interest_rate_max: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub borrow_interest_rate_min: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub borrow_interest_rate_increase: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub borrow_interest_rate_decrease: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub health_gain_factor: ::prost::alloc::string::String,
#[prost(int64, tag = "7")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub max_open_positions: i64,
#[prost(string, tag = "8")]
pub pool_open_threshold: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub borrow_interest_payment_fund_percentage: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub borrow_interest_payment_fund_address: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub safety_factor: ::prost::alloc::string::String,
#[prost(bool, tag = "12")]
pub borrow_interest_payment_enabled: bool,
#[prost(bool, tag = "13")]
pub whitelisting_enabled: bool,
#[prost(string, tag = "14")]
pub perpetual_swap_fee: ::prost::alloc::string::String,
#[prost(int64, tag = "15")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub max_limit_order: i64,
#[prost(string, tag = "16")]
pub fixed_funding_rate: ::prost::alloc::string::String,
#[prost(string, tag = "17")]
pub minimum_long_take_profit_price_ratio: ::prost::alloc::string::String,
#[prost(string, tag = "18")]
pub maximum_long_take_profit_price_ratio: ::prost::alloc::string::String,
#[prost(string, tag = "19")]
pub maximum_short_take_profit_price_ratio: ::prost::alloc::string::String,
#[prost(bool, tag = "20")]
pub enable_take_profit_custody_liabilities: bool,
#[prost(string, tag = "21")]
pub weight_breaking_fee_factor: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.Params")]
pub struct Params {
#[prost(string, tag = "1")]
pub leverage_max: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub borrow_interest_rate_max: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub borrow_interest_rate_min: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub borrow_interest_rate_increase: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub borrow_interest_rate_decrease: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub health_gain_factor: ::prost::alloc::string::String,
#[prost(int64, tag = "7")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub max_open_positions: i64,
#[prost(string, tag = "8")]
pub pool_open_threshold: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub borrow_interest_payment_fund_percentage: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub borrow_interest_payment_fund_address: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub safety_factor: ::prost::alloc::string::String,
#[prost(bool, tag = "12")]
pub borrow_interest_payment_enabled: bool,
#[prost(bool, tag = "13")]
pub whitelisting_enabled: bool,
#[prost(string, tag = "14")]
pub perpetual_swap_fee: ::prost::alloc::string::String,
#[prost(int64, tag = "15")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub max_limit_order: i64,
#[prost(string, tag = "16")]
pub fixed_funding_rate: ::prost::alloc::string::String,
#[prost(string, tag = "17")]
pub minimum_long_take_profit_price_ratio: ::prost::alloc::string::String,
#[prost(string, tag = "18")]
pub maximum_long_take_profit_price_ratio: ::prost::alloc::string::String,
#[prost(string, tag = "19")]
pub maximum_short_take_profit_price_ratio: ::prost::alloc::string::String,
#[prost(bool, tag = "20")]
pub enable_take_profit_custody_liabilities: bool,
#[prost(string, tag = "21")]
pub weight_breaking_fee_factor: ::prost::alloc::string::String,
#[prost(uint64, repeated, tag = "22")]
#[serde(
serialize_with = "crate::serde::as_str_vec::serialize",
deserialize_with = "crate::serde::as_str_vec::deserialize"
)]
pub enabled_pools: ::prost::alloc::vec::Vec<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.PoolAsset")]
pub struct PoolAsset {
#[prost(string, tag = "1")]
pub liabilities: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub custody: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub take_profit_liabilities: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub take_profit_custody: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub asset_denom: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub collateral: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.LegacyPool")]
pub struct LegacyPool {
#[prost(uint64, tag = "1")]
#[serde(alias = "amm_poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub amm_pool_id: u64,
#[prost(string, tag = "2")]
pub health: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub borrow_interest_rate: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub pool_assets_long: ::prost::alloc::vec::Vec<PoolAsset>,
#[prost(message, repeated, tag = "5")]
pub pool_assets_short: ::prost::alloc::vec::Vec<PoolAsset>,
#[prost(int64, tag = "6")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_height_borrow_interest_rate_computed: i64,
#[prost(string, tag = "7")]
pub funding_rate: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "8")]
pub fees_collected: ::prost::alloc::vec::Vec<super::super::cosmos::base::v1beta1::Coin>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.Pool")]
pub struct Pool {
#[prost(uint64, tag = "1")]
#[serde(alias = "amm_poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub amm_pool_id: u64,
#[prost(string, tag = "2")]
pub health: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub borrow_interest_rate: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub pool_assets_long: ::prost::alloc::vec::Vec<PoolAsset>,
#[prost(message, repeated, tag = "5")]
pub pool_assets_short: ::prost::alloc::vec::Vec<PoolAsset>,
#[prost(int64, tag = "6")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_height_borrow_interest_rate_computed: i64,
#[prost(string, tag = "7")]
pub funding_rate: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "8")]
pub fees_collected: ::prost::alloc::vec::Vec<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "9")]
pub leverage_max: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MTP")]
pub struct Mtp {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub collateral_asset: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub trading_asset: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub liabilities_asset: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub custody_asset: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub collateral: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub liabilities: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub borrow_interest_paid_custody: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub borrow_interest_unpaid_liability: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub custody: ::prost::alloc::string::String,
#[prost(string, tag = "12")]
pub take_profit_liabilities: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub take_profit_custody: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub mtp_health: ::prost::alloc::string::String,
#[prost(enumeration = "Position", tag = "15")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub position: i32,
#[prost(uint64, tag = "16")]
#[serde(alias = "ID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub id: u64,
#[prost(uint64, tag = "17")]
#[serde(alias = "amm_poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub amm_pool_id: u64,
#[prost(string, tag = "18")]
pub take_profit_price: ::prost::alloc::string::String,
#[prost(string, tag = "19")]
pub take_profit_borrow_factor: ::prost::alloc::string::String,
#[prost(string, tag = "20")]
pub funding_fee_paid_custody: ::prost::alloc::string::String,
#[prost(string, tag = "21")]
pub funding_fee_received_custody: ::prost::alloc::string::String,
#[prost(string, tag = "22")]
pub open_price: ::prost::alloc::string::String,
#[prost(string, tag = "23")]
pub stop_loss_price: ::prost::alloc::string::String,
#[prost(uint64, tag = "24")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_interest_calc_time: u64,
#[prost(uint64, tag = "25")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_interest_calc_block: u64,
#[prost(uint64, tag = "26")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_funding_calc_time: u64,
#[prost(uint64, tag = "27")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_funding_calc_block: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.InterestBlock")]
pub struct InterestBlock {
#[prost(string, tag = "1")]
pub interest_rate: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub block_height: i64,
#[prost(int64, tag = "3")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub block_time: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.FundingRateBlock")]
pub struct FundingRateBlock {
#[prost(string, tag = "1")]
pub funding_rate_long: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub funding_rate_short: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub funding_amount_short: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub funding_amount_long: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub block_height: i64,
#[prost(int64, tag = "6")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub block_time: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.WhiteList")]
pub struct WhiteList {
#[prost(string, repeated, tag = "1")]
pub validator_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.PositionRequest")]
pub struct PositionRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
#[serde(alias = "ID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub id: u64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)]
pub enum Position {
Unspecified = 0,
Long = 1,
Short = 2,
}
impl Position {
pub fn as_str_name(&self) -> &'static str {
match self {
Position::Unspecified => "UNSPECIFIED",
Position::Long => "LONG",
Position::Short => "SHORT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"UNSPECIFIED" => Some(Self::Unspecified),
"LONG" => Some(Self::Long),
"SHORT" => Some(Self::Short),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.GenesisState")]
pub struct GenesisState {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
#[prost(message, repeated, tag = "2")]
pub pool_list: ::prost::alloc::vec::Vec<Pool>,
#[prost(message, repeated, tag = "3")]
pub mtp_list: ::prost::alloc::vec::Vec<Mtp>,
#[prost(string, repeated, tag = "4")]
pub address_whitelist: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.Fees")]
pub struct Fees {
#[prost(string, tag = "1")]
pub total_fees_base_currency: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub borrow_interest_fees_liability_asset: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub borrow_interest_fees_base_currency: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub funding_fees_liquidity_asset: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub funding_fees_base_currency: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MtpAndPrice")]
pub struct MtpAndPrice {
#[prost(message, optional, tag = "1")]
pub mtp: ::core::option::Option<Mtp>,
#[prost(string, tag = "2")]
pub trading_asset_price: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub pnl: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "4")]
pub effective_leverage: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub liquidation_price: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub fees: ::core::option::Option<Fees>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.ParamsRequest")]
#[proto_query(path = "/elys.perpetual.Query/Params", response_type = ParamsResponse)]
pub struct ParamsRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.ParamsResponse")]
pub struct ParamsResponse {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.PositionsRequest")]
#[proto_query(
path = "/elys.perpetual.Query/GetPositions",
response_type = PositionsResponse
)]
pub struct PositionsRequest {
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.PositionsResponse")]
pub struct PositionsResponse {
#[prost(message, repeated, tag = "1")]
pub mtps: ::prost::alloc::vec::Vec<MtpAndPrice>,
#[prost(message, optional, tag = "2")]
pub pagination:
::core::option::Option<super::super::cosmos::base::query::v1beta1::PageResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.PositionsByPoolRequest")]
#[proto_query(
path = "/elys.perpetual.Query/GetPositionsByPool",
response_type = PositionsByPoolResponse
)]
pub struct PositionsByPoolRequest {
#[prost(uint64, tag = "1")]
#[serde(alias = "amm_poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub amm_pool_id: u64,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.PositionsByPoolResponse")]
pub struct PositionsByPoolResponse {
#[prost(message, repeated, tag = "1")]
pub mtps: ::prost::alloc::vec::Vec<MtpAndPrice>,
#[prost(message, optional, tag = "2")]
pub pagination:
::core::option::Option<super::super::cosmos::base::query::v1beta1::PageResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.StatusRequest")]
#[proto_query(path = "/elys.perpetual.Query/GetStatus", response_type = StatusResponse)]
pub struct StatusRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.StatusResponse")]
pub struct StatusResponse {
#[prost(uint64, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub open_mtp_count: u64,
#[prost(uint64, tag = "2")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub lifetime_mtp_count: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.PositionsForAddressRequest")]
#[proto_query(
path = "/elys.perpetual.Query/GetPositionsForAddress",
response_type = PositionsForAddressResponse
)]
pub struct PositionsForAddressRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.PositionsForAddressResponse")]
pub struct PositionsForAddressResponse {
#[prost(message, repeated, tag = "1")]
pub mtps: ::prost::alloc::vec::Vec<MtpAndPrice>,
#[prost(message, optional, tag = "2")]
pub pagination:
::core::option::Option<super::super::cosmos::base::query::v1beta1::PageResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.WhitelistRequest")]
#[proto_query(
path = "/elys.perpetual.Query/GetWhitelist",
response_type = WhitelistResponse
)]
pub struct WhitelistRequest {
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.WhitelistResponse")]
pub struct WhitelistResponse {
#[prost(string, repeated, tag = "1")]
pub whitelist: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub pagination:
::core::option::Option<super::super::cosmos::base::query::v1beta1::PageResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.IsWhitelistedRequest")]
#[proto_query(
path = "/elys.perpetual.Query/IsWhitelisted",
response_type = IsWhitelistedResponse
)]
pub struct IsWhitelistedRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.IsWhitelistedResponse")]
pub struct IsWhitelistedResponse {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub is_whitelisted: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.QueryGetPoolRequest")]
#[proto_query(path = "/elys.perpetual.Query/Pool", response_type = QueryGetPoolResponse)]
pub struct QueryGetPoolRequest {
#[prost(uint64, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub index: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.QueryGetPoolResponse")]
pub struct QueryGetPoolResponse {
#[prost(message, optional, tag = "1")]
pub pool: ::core::option::Option<PoolResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.QueryAllPoolRequest")]
#[proto_query(
path = "/elys.perpetual.Query/Pools",
response_type = QueryAllPoolResponse
)]
pub struct QueryAllPoolRequest {
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.QueryAllPoolResponse")]
pub struct QueryAllPoolResponse {
#[prost(message, repeated, tag = "1")]
pub pool: ::prost::alloc::vec::Vec<PoolResponse>,
#[prost(message, optional, tag = "2")]
pub pagination:
::core::option::Option<super::super::cosmos::base::query::v1beta1::PageResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MTPRequest")]
#[proto_query(path = "/elys.perpetual.Query/MTP", response_type = MtpResponse)]
pub struct MtpRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
#[serde(alias = "ID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub id: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MTPResponse")]
pub struct MtpResponse {
#[prost(message, optional, tag = "1")]
pub mtp: ::core::option::Option<MtpAndPrice>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.QueryOpenEstimationRequest")]
#[proto_query(
path = "/elys.perpetual.Query/OpenEstimation",
response_type = QueryOpenEstimationResponse
)]
pub struct QueryOpenEstimationRequest {
#[prost(enumeration = "Position", tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub position: i32,
#[prost(string, tag = "2")]
pub leverage: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub trading_asset: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub collateral: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "5")]
pub address: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub take_profit_price: ::prost::alloc::string::String,
#[prost(uint64, tag = "7")]
#[serde(alias = "poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub pool_id: u64,
#[prost(string, tag = "8")]
pub limit_price: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.QueryOpenEstimationResponse")]
pub struct QueryOpenEstimationResponse {
#[prost(enumeration = "Position", tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub position: i32,
#[prost(string, tag = "2")]
pub effective_leverage: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub trading_asset: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub collateral: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "5")]
pub hourly_interest_rate: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub position_size: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "7")]
pub open_price: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub take_profit_price: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub liquidation_price: ::prost::alloc::string::String,
#[prost(message, optional, tag = "10")]
pub estimated_pnl: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(message, optional, tag = "11")]
pub available_liquidity: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "12")]
pub slippage: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub borrow_interest_rate: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub funding_rate: ::prost::alloc::string::String,
#[prost(string, tag = "15")]
pub price_impact: ::prost::alloc::string::String,
#[prost(message, optional, tag = "16")]
pub custody: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(message, optional, tag = "17")]
pub liabilities: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "18")]
pub limit_price: ::prost::alloc::string::String,
#[prost(string, tag = "19")]
pub weight_breaking_fee: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.PoolResponse")]
pub struct PoolResponse {
#[prost(uint64, tag = "1")]
#[serde(alias = "amm_poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub amm_pool_id: u64,
#[prost(string, tag = "2")]
pub health: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub borrow_interest_rate: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub pool_assets_long: ::prost::alloc::vec::Vec<PoolAsset>,
#[prost(message, repeated, tag = "5")]
pub pool_assets_short: ::prost::alloc::vec::Vec<PoolAsset>,
#[prost(int64, tag = "6")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub last_height_borrow_interest_rate_computed: i64,
#[prost(string, tag = "7")]
pub funding_rate: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub net_open_interest: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub long_rate: ::prost::alloc::string::String,
#[prost(string, tag = "10")]
pub short_rate: ::prost::alloc::string::String,
#[prost(message, optional, tag = "11")]
pub total_liabilities: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "12")]
pub total_long_open_interest: ::prost::alloc::string::String,
#[prost(string, tag = "13")]
pub total_short_open_interest: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub leverage_max: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.QueryCloseEstimationRequest")]
#[proto_query(
path = "/elys.perpetual.Query/CloseEstimation",
response_type = QueryCloseEstimationResponse
)]
pub struct QueryCloseEstimationRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
#[serde(alias = "positionID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub position_id: u64,
#[prost(string, tag = "3")]
pub close_amount: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.QueryCloseEstimationResponse")]
pub struct QueryCloseEstimationResponse {
#[prost(enumeration = "Position", tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub position: i32,
#[prost(message, optional, tag = "2")]
pub position_size: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(message, optional, tag = "3")]
pub liabilities: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "4")]
pub price_impact: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub liquidation_price: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub max_close_amount: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub borrow_interest_unpaid_liability:
::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(message, optional, tag = "8")]
pub returning_amount: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(message, optional, tag = "9")]
pub paying_liabilities: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "10")]
pub closing_price: ::prost::alloc::string::String,
#[prost(message, optional, tag = "11")]
pub custody: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(message, optional, tag = "12")]
pub collateral: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "13")]
pub weight_breaking_fee: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub slippage: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgOpen")]
pub struct MsgOpen {
#[prost(string, tag = "1")]
pub creator: ::prost::alloc::string::String,
#[prost(enumeration = "Position", tag = "2")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub position: i32,
#[prost(string, tag = "3")]
pub leverage: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub trading_asset: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub collateral: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
#[prost(string, tag = "6")]
pub take_profit_price: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub stop_loss_price: ::prost::alloc::string::String,
#[prost(uint64, tag = "8")]
#[serde(alias = "poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub pool_id: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgOpenResponse")]
pub struct MsgOpenResponse {
#[prost(uint64, tag = "1")]
#[serde(alias = "ID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub id: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgClose")]
pub struct MsgClose {
#[prost(string, tag = "1")]
pub creator: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
#[serde(alias = "ID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub id: u64,
#[prost(string, tag = "3")]
pub amount: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgCloseResponse")]
pub struct MsgCloseResponse {
#[prost(uint64, tag = "1")]
#[serde(alias = "ID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub id: u64,
#[prost(string, tag = "2")]
pub amount: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgUpdateParams")]
pub struct MsgUpdateParams {
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<Params>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgUpdateParamsResponse")]
pub struct MsgUpdateParamsResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgWhitelist")]
pub struct MsgWhitelist {
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub whitelisted_address: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgWhitelistResponse")]
pub struct MsgWhitelistResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgDewhitelist")]
pub struct MsgDewhitelist {
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub whitelisted_address: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgDewhitelistResponse")]
pub struct MsgDewhitelistResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgClosePositions")]
pub struct MsgClosePositions {
#[prost(string, tag = "1")]
pub creator: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub liquidate: ::prost::alloc::vec::Vec<PositionRequest>,
#[prost(message, repeated, tag = "3")]
pub stop_loss: ::prost::alloc::vec::Vec<PositionRequest>,
#[prost(message, repeated, tag = "4")]
pub take_profit: ::prost::alloc::vec::Vec<PositionRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgClosePositionsResponse")]
pub struct MsgClosePositionsResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgUpdateStopLoss")]
pub struct MsgUpdateStopLoss {
#[prost(string, tag = "1")]
pub creator: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
#[serde(alias = "ID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub id: u64,
#[prost(string, tag = "3")]
pub price: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgUpdateStopLossResponse")]
pub struct MsgUpdateStopLossResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgUpdateTakeProfitPrice")]
pub struct MsgUpdateTakeProfitPrice {
#[prost(string, tag = "1")]
pub creator: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
#[serde(alias = "ID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub id: u64,
#[prost(string, tag = "3")]
pub price: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgUpdateTakeProfitPriceResponse")]
pub struct MsgUpdateTakeProfitPriceResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgUpdateMaxLeverageForPool")]
pub struct MsgUpdateMaxLeverageForPool {
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
#[serde(alias = "poolID")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub pool_id: u64,
#[prost(string, tag = "3")]
pub leverage_max: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgUpdateMaxLeverageForPoolResponse")]
pub struct MsgUpdateMaxLeverageForPoolResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgUpdateEnabledPools")]
pub struct MsgUpdateEnabledPools {
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
#[prost(uint64, repeated, tag = "2")]
#[serde(
serialize_with = "crate::serde::as_str_vec::serialize",
deserialize_with = "crate::serde::as_str_vec::deserialize"
)]
pub enabled_pools: ::prost::alloc::vec::Vec<u64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/elys.perpetual.MsgUpdateEnabledPoolsResponse")]
pub struct MsgUpdateEnabledPoolsResponse {}
pub struct PerpetualQuerier<'a, Q: cosmwasm_std::CustomQuery> {
querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
}
impl<'a, Q: cosmwasm_std::CustomQuery> PerpetualQuerier<'a, Q> {
pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self {
Self { querier }
}
pub fn params(&self) -> Result<ParamsResponse, cosmwasm_std::StdError> {
ParamsRequest {}.query(self.querier)
}
pub fn get_positions(
&self,
pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
) -> Result<PositionsResponse, cosmwasm_std::StdError> {
PositionsRequest { pagination }.query(self.querier)
}
pub fn get_positions_by_pool(
&self,
amm_pool_id: u64,
pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
) -> Result<PositionsByPoolResponse, cosmwasm_std::StdError> {
PositionsByPoolRequest {
amm_pool_id,
pagination,
}
.query(self.querier)
}
pub fn get_status(&self) -> Result<StatusResponse, cosmwasm_std::StdError> {
StatusRequest {}.query(self.querier)
}
pub fn get_positions_for_address(
&self,
address: ::prost::alloc::string::String,
pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
) -> Result<PositionsForAddressResponse, cosmwasm_std::StdError> {
PositionsForAddressRequest {
address,
pagination,
}
.query(self.querier)
}
pub fn get_whitelist(
&self,
pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
) -> Result<WhitelistResponse, cosmwasm_std::StdError> {
WhitelistRequest { pagination }.query(self.querier)
}
pub fn is_whitelisted(
&self,
address: ::prost::alloc::string::String,
) -> Result<IsWhitelistedResponse, cosmwasm_std::StdError> {
IsWhitelistedRequest { address }.query(self.querier)
}
pub fn pool(&self, index: u64) -> Result<QueryGetPoolResponse, cosmwasm_std::StdError> {
QueryGetPoolRequest { index }.query(self.querier)
}
pub fn pools(
&self,
pagination: ::core::option::Option<super::super::cosmos::base::query::v1beta1::PageRequest>,
) -> Result<QueryAllPoolResponse, cosmwasm_std::StdError> {
QueryAllPoolRequest { pagination }.query(self.querier)
}
pub fn mtp(
&self,
address: ::prost::alloc::string::String,
id: u64,
) -> Result<MtpResponse, cosmwasm_std::StdError> {
MtpRequest { address, id }.query(self.querier)
}
pub fn open_estimation(
&self,
position: i32,
leverage: ::prost::alloc::string::String,
trading_asset: ::prost::alloc::string::String,
collateral: ::core::option::Option<super::super::cosmos::base::v1beta1::Coin>,
address: ::prost::alloc::string::String,
take_profit_price: ::prost::alloc::string::String,
pool_id: u64,
limit_price: ::prost::alloc::string::String,
) -> Result<QueryOpenEstimationResponse, cosmwasm_std::StdError> {
QueryOpenEstimationRequest {
position,
leverage,
trading_asset,
collateral,
address,
take_profit_price,
pool_id,
limit_price,
}
.query(self.querier)
}
pub fn close_estimation(
&self,
address: ::prost::alloc::string::String,
position_id: u64,
close_amount: ::prost::alloc::string::String,
) -> Result<QueryCloseEstimationResponse, cosmwasm_std::StdError> {
QueryCloseEstimationRequest {
address,
position_id,
close_amount,
}
.query(self.querier)
}
}