pub struct CreateRecurringOrderRequest {
pub user: String,
pub input_mint: String,
pub output_mint: String,
pub params: OrderParams,
}Expand description
Represents a request to create a recurring order, either time-based or price-based.
Fields§
§user: StringThe wallet address initiating the order.
input_mint: StringThe mint address of the input SPL token.
output_mint: StringThe mint address of the output SPL token.
params: OrderParamsParameters for the recurring order, either time-based or price-based.
Implementations§
Source§impl CreateRecurringOrderRequest
impl CreateRecurringOrderRequest
Sourcepub fn new_time_order(
user: impl Into<String>,
input_mint: impl Into<String>,
output_mint: impl Into<String>,
in_amount: u64,
number_of_orders: u64,
interval: u64,
) -> Self
pub fn new_time_order( user: impl Into<String>, input_mint: impl Into<String>, output_mint: impl Into<String>, in_amount: u64, number_of_orders: u64, interval: u64, ) -> Self
Creates a new time-based recurring order.
§Arguments
user- The user wallet address.input_mint- SPL token mint address for the input token.output_mint- SPL token mint address for the output token.in_amount- Total input amount to be divided.number_of_orders- How many times the order should be placed.interval- Time gap between each order (in seconds).
Sourcepub fn new_price_order(
user: impl Into<String>,
input_mint: impl Into<String>,
output_mint: impl Into<String>,
deposit_amount: u64,
increment_usdc_value: u64,
interval: u64,
) -> Self
pub fn new_price_order( user: impl Into<String>, input_mint: impl Into<String>, output_mint: impl Into<String>, deposit_amount: u64, increment_usdc_value: u64, interval: u64, ) -> Self
Creates a new price-based recurring order.
§Arguments
user- The user wallet address.input_mint- SPL token mint address for the input token.output_mint- SPL token mint address for the output token.deposit_amount- Total amount to deposit.increment_usdc_value- Price increment in USDC for each order trigger.interval- Minimum interval between executions (in seconds).
Sourcepub fn with_start_at(self, start_at: u64) -> Self
pub fn with_start_at(self, start_at: u64) -> Self
Sets the start_at Unix timestamp to delay the start of the recurring order.
Sourcepub fn with_min_price(self, price: f64) -> Self
pub fn with_min_price(self, price: f64) -> Self
Sets the optional min_price threshold for a time-based order.
Sourcepub fn with_max_price(self, price: f64) -> Self
pub fn with_max_price(self, price: f64) -> Self
Sets the optional max_price threshold for a time-based order.
Trait Implementations§
Source§impl Debug for CreateRecurringOrderRequest
impl Debug for CreateRecurringOrderRequest
Source§impl<'de> Deserialize<'de> for CreateRecurringOrderRequest
impl<'de> Deserialize<'de> for CreateRecurringOrderRequest
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
Auto Trait Implementations§
impl Freeze for CreateRecurringOrderRequest
impl RefUnwindSafe for CreateRecurringOrderRequest
impl Send for CreateRecurringOrderRequest
impl Sync for CreateRecurringOrderRequest
impl Unpin for CreateRecurringOrderRequest
impl UnsafeUnpin for CreateRecurringOrderRequest
impl UnwindSafe for CreateRecurringOrderRequest
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