pub struct PostOnlyOrderTemplate {
pub side: Side,
pub price_as_float: f64,
pub size_in_base_units: f64,
pub client_order_id: u128,
pub reject_post_only: bool,
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
PostOnlyOrderTemplate is a helper type for creating a post-only order, which will never be matched against existing orders. 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 post-only order instruction, ready to be sent.
Fields§
§side: Side
§price_as_float: f64
The 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: f64
Total number of base units, as a floating point number, to place on the book or fill at a better price.
client_order_id: u128
Client order id used to identify the order in the response to the client.
reject_post_only: bool
Flag for whether or not to reject the order if it would immediately match or amend it to the best non-crossing price. Default value is true.
use_only_deposited_funds: bool
Flag 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: bool
Flag 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 PostOnlyOrderTemplate
impl RefUnwindSafe for PostOnlyOrderTemplate
impl Send for PostOnlyOrderTemplate
impl Sync for PostOnlyOrderTemplate
impl Unpin for PostOnlyOrderTemplate
impl UnwindSafe for PostOnlyOrderTemplate
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