pub struct OracleBins {
pub bins: [u16; 100],
}Expand description
Phase histogram: counts per bin for frac(log10(sats))
Used for on-chain price discovery. Each bin represents 1% of the log10 fractional range [0, 1). Values are u16 (max 65535 per bin).
Fields§
§bins: [u16; 100]Implementations§
Source§impl OracleBins
impl OracleBins
pub const ZERO: OracleBins
Sourcepub fn sats_to_bin(sats: Sats) -> Option<usize>
pub fn sats_to_bin(sats: Sats) -> Option<usize>
Get the bin index for a sats value Filters: min 1k sats, max 100k BTC (matches Python 1e-5 to 1e5 BTC)
Sourcepub fn total_count(&self) -> u32
pub fn total_count(&self) -> u32
Get total count across all bins
Trait Implementations§
Source§impl Bytes for OracleBins
impl Bytes for OracleBins
Source§impl Clone for OracleBins
impl Clone for OracleBins
Source§fn clone(&self) -> OracleBins
fn clone(&self) -> OracleBins
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OracleBins
impl Debug for OracleBins
Source§impl Default for OracleBins
impl Default for OracleBins
Source§fn default() -> OracleBins
fn default() -> OracleBins
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OracleBins
impl<'de> Deserialize<'de> for OracleBins
Source§fn deserialize<D>(
deserializer: D,
) -> Result<OracleBins, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<OracleBins, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for OracleBins
impl Display for OracleBins
Source§impl Formattable for OracleBins
impl Formattable for OracleBins
Source§impl JsonSchema for OracleBins
impl JsonSchema for OracleBins
Source§fn json_schema(_gen: &mut SchemaGenerator) -> Schema
fn json_schema(_gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for OracleBins
impl PartialEq for OracleBins
Source§impl Serialize for OracleBins
impl Serialize for OracleBins
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for OracleBins
impl Eq for OracleBins
impl StructuralPartialEq for OracleBins
Auto Trait Implementations§
impl Freeze for OracleBins
impl RefUnwindSafe for OracleBins
impl Send for OracleBins
impl Sync for OracleBins
impl Unpin for OracleBins
impl UnwindSafe for OracleBins
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.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