Skip to main content

CreateRecurringOrderRequest

Struct CreateRecurringOrderRequest 

Source
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: String

The wallet address initiating the order.

§input_mint: String

The mint address of the input SPL token.

§output_mint: String

The mint address of the output SPL token.

§params: OrderParams

Parameters for the recurring order, either time-based or price-based.

Implementations§

Source§

impl CreateRecurringOrderRequest

Source

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).
Source

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).
Source

pub fn with_start_at(self, start_at: u64) -> Self

Sets the start_at Unix timestamp to delay the start of the recurring order.

Source

pub fn with_min_price(self, price: f64) -> Self

Sets the optional min_price threshold for a time-based order.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CreateRecurringOrderRequest

Source§

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 Serialize for CreateRecurringOrderRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more