pub struct SwapArgs {
pub deadline: i64,
pub amount_input: u64,
pub amount_output: u64,
pub referral_fee_bps: u16,
pub fee_token: FeeToken,
}
Expand description
For all swap instructions and contexts, input and output are defined with respect to the searcher
So mint_input
refers to the token that the searcher provides to the trader and
mint_output
refers to the token that the searcher receives from the trader
This choice is made to minimize confusion for the searchers, who are more likely to parse the program
Fields§
§deadline: i64
§amount_input: u64
§amount_output: u64
§referral_fee_bps: u16
§fee_token: FeeToken
Trait Implementations§
Source§impl BorshDeserialize for SwapArgswhere
i64: BorshDeserialize,
u64: BorshDeserialize,
u16: BorshDeserialize,
FeeToken: BorshDeserialize,
impl BorshDeserialize for SwapArgswhere
i64: BorshDeserialize,
u64: BorshDeserialize,
u16: BorshDeserialize,
FeeToken: BorshDeserialize,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§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.
Source§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 SwapArgs
impl BorshSerialize for SwapArgs
impl Copy for SwapArgs
impl Eq for SwapArgs
impl StructuralPartialEq for SwapArgs
Auto Trait Implementations§
impl Freeze for SwapArgs
impl RefUnwindSafe for SwapArgs
impl Send for SwapArgs
impl Sync for SwapArgs
impl Unpin for SwapArgs
impl UnwindSafe for SwapArgs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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