Struct big_strats_pkg::grid::definitions::UserPosition
source · pub struct UserPosition<SIC: SwapInterfaceCollector> {
pub id: u64,
pub owner: Addr,
pub quote_asset: Asset,
pub base_asset: Asset,
pub lower_bound: Decimal,
pub upper_bound: Decimal,
pub current_tick: Decimal,
pub tick_model: TickModel,
pub swap_module: SIC,
}Fields§
§id: u64§owner: Addr§quote_asset: Asset§base_asset: Asset§lower_bound: Decimal§upper_bound: Decimal§current_tick: Decimal§tick_model: TickModel§swap_module: SICImplementations§
source§impl<SIC> UserPosition<SIC>where
SIC: SwapInterfaceCollector,
impl<SIC> UserPosition<SIC>where SIC: SwapInterfaceCollector,
pub fn new<SICollector: SwapInterfaceCollector>( deps: Deps<'_>, config: &Config, id: u64, owner: Addr, msg: SetGridMsg<SICollector> ) -> StdResult<UserPosition<SICollector>>
pub fn validate(&mut self, deps: Deps<'_>, config: &Config) -> StdResult<()>
pub fn check_next_action( &self, deps: Deps<'_>, config: &Config ) -> StdResult<bool>
pub fn do_next_action( &self, deps: Deps<'_>, config: &Config ) -> StdResult<Option<(CosmosMsg, SwapDirection)>>
sourcepub fn set_current_tick(&mut self) -> StdResult<()>
pub fn set_current_tick(&mut self) -> StdResult<()>
Calculate and set the current_tick
Trait Implementations§
source§impl<SIC: Clone + SwapInterfaceCollector> Clone for UserPosition<SIC>
impl<SIC: Clone + SwapInterfaceCollector> Clone for UserPosition<SIC>
source§fn clone(&self) -> UserPosition<SIC>
fn clone(&self) -> UserPosition<SIC>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<SIC: Debug + SwapInterfaceCollector> Debug for UserPosition<SIC>
impl<SIC: Debug + SwapInterfaceCollector> Debug for UserPosition<SIC>
source§impl<'de, SIC> Deserialize<'de> for UserPosition<SIC>where
SIC: Deserialize<'de> + SwapInterfaceCollector,
impl<'de, SIC> Deserialize<'de> for UserPosition<SIC>where SIC: Deserialize<'de> + SwapInterfaceCollector,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a, SIC> IndexList<UserPosition<SIC>> for UserPositionIndexes<'a, SIC>where
SIC: SwapInterfaceCollector + Serialize + Clone + DeserializeOwned,
impl<'a, SIC> IndexList<UserPosition<SIC>> for UserPositionIndexes<'a, SIC>where SIC: SwapInterfaceCollector + Serialize + Clone + DeserializeOwned,
fn get_indexes( &self ) -> Box<dyn Iterator<Item = &dyn Index<UserPosition<SIC>>> + '_>
source§impl<SIC: SwapInterfaceCollector + JsonSchema> JsonSchema for UserPosition<SIC>
impl<SIC: SwapInterfaceCollector + JsonSchema> JsonSchema for UserPosition<SIC>
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moresource§impl<SIC: PartialEq + SwapInterfaceCollector> PartialEq for UserPosition<SIC>
impl<SIC: PartialEq + SwapInterfaceCollector> PartialEq for UserPosition<SIC>
source§fn eq(&self, other: &UserPosition<SIC>) -> bool
fn eq(&self, other: &UserPosition<SIC>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<SIC> Serialize for UserPosition<SIC>where
SIC: Serialize + SwapInterfaceCollector,
impl<SIC> Serialize for UserPosition<SIC>where SIC: Serialize + SwapInterfaceCollector,
impl<SIC: SwapInterfaceCollector> StructuralPartialEq for UserPosition<SIC>
Auto Trait Implementations§
impl<SIC> RefUnwindSafe for UserPosition<SIC>where SIC: RefUnwindSafe,
impl<SIC> Send for UserPosition<SIC>where SIC: Send,
impl<SIC> Sync for UserPosition<SIC>where SIC: Sync,
impl<SIC> Unpin for UserPosition<SIC>where SIC: Unpin,
impl<SIC> UnwindSafe for UserPosition<SIC>where SIC: UnwindSafe,
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moresource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more