Struct levana_perpswap_cosmos::contracts::market::entry::PositionAction
source · pub struct PositionAction {Show 14 fields
pub id: Option<PositionId>,
pub kind: PositionActionKind,
pub timestamp: Timestamp,
pub price_timestamp: Option<Timestamp>,
pub collateral: Collateral,
pub transfer_collateral: Signed<Collateral>,
pub leverage: Option<LeverageToBase>,
pub max_gains: Option<MaxGainsInQuote>,
pub trade_fee: Option<Usd>,
pub delta_neutrality_fee: Option<Signed<Usd>>,
pub old_owner: Option<Addr>,
pub new_owner: Option<Addr>,
pub take_profit_trader: Option<TakeProfitTrader>,
pub stop_loss_override: Option<PriceBaseInQuote>,
}
Expand description
A distinct position history action
Fields§
§id: Option<PositionId>
ID of the position impacted
For ease of migration, we allow for a missing position ID.
kind: PositionActionKind
Kind of action taken by the trader
timestamp: Timestamp
Timestamp when the action occurred
price_timestamp: Option<Timestamp>
Timestamp of the PricePoint used for this action, if relevant
collateral: Collateral
the amount of collateral at the time of the action
transfer_collateral: Signed<Collateral>
The amount of collateral transferred to or from the trader
leverage: Option<LeverageToBase>
Leverage of the position at the time of the action, if relevant
max_gains: Option<MaxGainsInQuote>
max gains in quote
trade_fee: Option<Usd>
the trade fee in USD
delta_neutrality_fee: Option<Signed<Usd>>
The delta neutrality fee paid (or, if negative, received) in USD
old_owner: Option<Addr>
If this is a position transfer, the previous owner.
new_owner: Option<Addr>
If this is a position transfer, the new owner.
take_profit_trader: Option<TakeProfitTrader>
The take profit price set by the trader. For historical reasons this is optional, i.e. if the trader had set max gains price instead
stop_loss_override: Option<PriceBaseInQuote>
The stop loss override, if set.
Trait Implementations§
source§impl Clone for PositionAction
impl Clone for PositionAction
source§fn clone(&self) -> PositionAction
fn clone(&self) -> PositionAction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PositionAction
impl Debug for PositionAction
source§impl<'de> Deserialize<'de> for PositionAction
impl<'de> Deserialize<'de> for PositionAction
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>,
source§impl JsonSchema for PositionAction
impl JsonSchema for PositionAction
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl PartialEq for PositionAction
impl PartialEq for PositionAction
source§fn eq(&self, other: &PositionAction) -> bool
fn eq(&self, other: &PositionAction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for PositionAction
impl Serialize for PositionAction
impl StructuralPartialEq for PositionAction
Auto Trait Implementations§
impl Freeze for PositionAction
impl RefUnwindSafe for PositionAction
impl Send for PositionAction
impl Sync for PositionAction
impl Unpin for PositionAction
impl UnwindSafe for PositionAction
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>,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more