pub struct RateLimitStatus {
pub remaining: Option<u32>,
pub reset: Option<u64>,
pub tier: Option<Tier>,
pub warning: bool,
}Expand description
What the venue reported about a signer’s trading allowance on one response.
Polymarket returns these on every evaluated order/cancel request. They are the only way a client learns its own tier, since tier derives from 30-day volume that the client cannot compute.
Every field is optional: the headers are absent on responses that never reached the trading limiter (market data, auth, anything non-trading), and a malformed value is dropped rather than guessed.
Fields§
§remaining: Option<u32>Poly-RateLimit-Remaining — token balance after this request.
reset: Option<u64>Poly-RateLimit-Reset — Unix timestamp when the wait period ends.
tier: Option<Tier>Poly-RateLimit-Tier — the tier the venue applied.
warning: boolPoly-RateLimit-Warning — true when the venue is in warning mode.
Implementations§
Source§impl RateLimitStatus
impl RateLimitStatus
Sourcepub fn from_headers(headers: &HeaderMap) -> Self
pub fn from_headers(headers: &HeaderMap) -> Self
Read the Poly-RateLimit-* family from a response’s headers.
Returns an all-None value rather than an error when the headers are
absent, so callers need not distinguish “not a trading request” from
“trading request with no telemetry”.
Trait Implementations§
Source§impl Clone for RateLimitStatus
impl Clone for RateLimitStatus
Source§fn clone(&self) -> RateLimitStatus
fn clone(&self) -> RateLimitStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more