pub struct LimitOrderTemplate {
pub side: Side,
pub price_as_float: f64,
pub size_in_base_units: f64,
pub self_trade_behavior: SelfTradeBehavior,
pub match_limit: Option<u64>,
pub client_order_id: u128,
pub use_only_deposited_funds: bool,
pub last_valid_slot: Option<u64>,
pub last_valid_unix_timestamp_in_seconds: Option<u64>,
pub fail_silently_on_insufficient_funds: bool,
}Expand description
LimitOrderTemplate is a helper type for creating a limit order. The template allows you to specify the price and size in commonly understood units: price is the floating point price (units of USDC per unit of SOL for the SOL/USDC market), and size is in whole base units (units of SOL for the SOL/USDC market). The SDK can then convert this to a limit order instruction, ready to be sent.
Fields§
§side: Side§price_as_float: f64The price of the order, as the commonly understood exchange price (the number of quote units to exchange for one base unit), as a floating point number.
size_in_base_units: f64Total number of base units, as a floating point number, to place on the book or fill at a better price.
self_trade_behavior: SelfTradeBehaviorHow the matching engine should handle a self trade.
match_limit: Option<u64>Number of orders to match against. If this is None there is no limit.
client_order_id: u128Client order id used to identify the order in the response to the client.
use_only_deposited_funds: boolFlag for whether or not the order should only use funds that are already in the account. Using only deposited funds will allow the trader to pass in fewer accounts per instruction and save transaction space as well as compute.
last_valid_slot: Option<u64>If this is set, the order will be invalid after the specified slot.
last_valid_unix_timestamp_in_seconds: Option<u64>If this is set, the order will be invalid after the specified unix timestamp.
fail_silently_on_insufficient_funds: boolFlag for whether or not to have the entire transaction fail if there are insufficient funds to place the order. When set to true and there are insufficient funds, the order will not be placed but the transaction will not immediately fail.
Auto Trait Implementations§
impl Freeze for LimitOrderTemplate
impl RefUnwindSafe for LimitOrderTemplate
impl Send for LimitOrderTemplate
impl Sync for LimitOrderTemplate
impl Unpin for LimitOrderTemplate
impl UnwindSafe for LimitOrderTemplate
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request