#[repr(C)]pub struct TradeData {Show 20 fields
pub trade_id: u64,
pub authority: Pubkey,
pub store: Pubkey,
pub market_token: Pubkey,
pub user: Pubkey,
pub position: Pubkey,
pub order: Pubkey,
pub final_output_token: Pubkey,
pub ts: i64,
pub slot: u64,
pub before: PositionState,
pub after: PositionState,
pub transfer_out: TransferOut,
pub prices: TradePrices,
pub execution_price: u128,
pub price_impact_value: i128,
pub price_impact_diff: u128,
pub pnl: TradePnl,
pub fees: TradeFees,
pub output_amounts: TradeOutputAmounts,
/* private fields */
}Expand description
Trade event data.
Fields§
§trade_id: u64Trade id.
Authority.
store: PubkeyStore address.
market_token: PubkeyMarket token.
user: PubkeyUser.
position: PubkeyPosition address.
order: PubkeyOrder address.
final_output_token: PubkeyFinal output token.
ts: i64Trade ts.
slot: u64Trade slot.
before: PositionStateBefore state.
after: PositionStateAfter state.
transfer_out: TransferOutTransfer out.
prices: TradePricesPrices.
execution_price: u128Execution price.
price_impact_value: i128Price impact value.
price_impact_diff: u128Price impact diff.
pnl: TradePnlProcessed pnl.
fees: TradeFeesFees.
output_amounts: TradeOutputAmountsOutput amounts.
Implementations§
Trait Implementations§
Source§impl AccountDeserialize for TradeData
impl AccountDeserialize for TradeData
Source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a
Mint account into a token
Account.Source§fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
Deserializes account data without checking the account discriminator.
This should only be used on account initialization, when the bytes of
the account are zeroed.
Source§impl BorshDeserialize for TradeDatawhere
u8: BorshDeserialize,
[u8; 7]: BorshDeserialize,
u64: BorshDeserialize,
Pubkey: BorshDeserialize,
i64: BorshDeserialize,
PositionState: BorshDeserialize,
TransferOut: BorshDeserialize,
[u8; 8]: BorshDeserialize,
TradePrices: BorshDeserialize,
u128: BorshDeserialize,
i128: BorshDeserialize,
TradePnl: BorshDeserialize,
TradeFees: BorshDeserialize,
TradeOutputAmounts: BorshDeserialize,
impl BorshDeserialize for TradeDatawhere
u8: BorshDeserialize,
[u8; 7]: BorshDeserialize,
u64: BorshDeserialize,
Pubkey: BorshDeserialize,
i64: BorshDeserialize,
PositionState: BorshDeserialize,
TransferOut: BorshDeserialize,
[u8; 8]: BorshDeserialize,
TradePrices: BorshDeserialize,
u128: BorshDeserialize,
i128: BorshDeserialize,
TradePnl: BorshDeserialize,
TradeFees: BorshDeserialize,
TradeOutputAmounts: BorshDeserialize,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for TradeDatawhere
u8: BorshSerialize,
[u8; 7]: BorshSerialize,
u64: BorshSerialize,
Pubkey: BorshSerialize,
i64: BorshSerialize,
PositionState: BorshSerialize,
TransferOut: BorshSerialize,
[u8; 8]: BorshSerialize,
TradePrices: BorshSerialize,
u128: BorshSerialize,
i128: BorshSerialize,
TradePnl: BorshSerialize,
TradeFees: BorshSerialize,
TradeOutputAmounts: BorshSerialize,
impl BorshSerialize for TradeDatawhere
u8: BorshSerialize,
[u8; 7]: BorshSerialize,
u64: BorshSerialize,
Pubkey: BorshSerialize,
i64: BorshSerialize,
PositionState: BorshSerialize,
TransferOut: BorshSerialize,
[u8; 8]: BorshSerialize,
TradePrices: BorshSerialize,
u128: BorshSerialize,
i128: BorshSerialize,
TradePnl: BorshSerialize,
TradeFees: BorshSerialize,
TradeOutputAmounts: BorshSerialize,
Source§impl<'de> Deserialize<'de> for TradeData
impl<'de> Deserialize<'de> for TradeData
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 Discriminator for TradeData
impl Discriminator for TradeData
const DISCRIMINATOR: [u8; 8]
fn discriminator() -> [u8; 8]
impl Copy for TradeData
impl Pod for TradeData
impl ZeroCopy for TradeData
Auto Trait Implementations§
impl Freeze for TradeData
impl RefUnwindSafe for TradeData
impl Send for TradeData
impl Sync for TradeData
impl Unpin for TradeData
impl UnwindSafe for TradeData
Blanket Implementations§
Source§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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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