pub struct Trade {
pub amount_in: BigUint,
pub amount_out: BigUint,
}Expand description
Represents a trade between two tokens at a given price on a pool.
§Fields
amount_in- The amount of token_in (what you pay)amount_out- The amount of token_out (what you receive)
The price of the trade is the ratio of amount_out to amount_in, i.e. amount_out / amount_in.
Fields§
§amount_in: BigUint§amount_out: BigUintImplementations§
Trait Implementations§
impl Eq for Trade
impl StructuralPartialEq for Trade
Auto Trait Implementations§
impl Freeze for Trade
impl RefUnwindSafe for Trade
impl Send for Trade
impl Sync for Trade
impl Unpin for Trade
impl UnwindSafe for Trade
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.