pub struct AuthData {
pub min_rate: f64,
pub max_rate: f64,
pub min_trade: f64,
pub max_trade: f64,
}Expand description
The supported constraints for an authorization.
An AuthData defines the trading constraints for an authorization:
- Rate constraints limit how fast a portfolio can be traded (in units per time)
- Trade constraints limit the total accumulated trade amount over time
The rate constraints must allow the possibility of zero trade (min_rate ≤ 0 ≤ max_rate).
The trade constraints do not have this restriction, but instead, at time of specification, they should allow for the currently traded amount of the auth. If they do not, the trade constraint is implicitly expanded to include 0 at each auction, which may not be desired.
Fields§
§min_rate: f64The fastest rate at which the portfolio may sell (non-positive)
max_rate: f64The fastest rate at which the portfolio may buy (non-negative)
min_trade: f64A minimum amount of trade to preserve (always enforced against the authorization’s contemporaneous amount of trade)
max_trade: f64A maximum amount of trade to preserve (always enforced against the authorization’s contemporaneous amount of trade)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AuthData
impl<'de> Deserialize<'de> for AuthData
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>,
impl StructuralPartialEq for AuthData
Auto Trait Implementations§
impl Freeze for AuthData
impl RefUnwindSafe for AuthData
impl Send for AuthData
impl Sync for AuthData
impl Unpin for AuthData
impl UnwindSafe for AuthData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more