brk_types 0.3.0-beta.6

Structs used throughout BRK
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use crate::{Bitcoin, Dollars};

/// A single bucket in a URPD snapshot.
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema)]
pub struct UrpdBucket {
    /// Inclusive lower bound of the bucket, in USD.
    pub price_floor: Dollars,
    /// Supply held with a last-move price inside this bucket, in BTC.
    pub supply: Bitcoin,
    /// Realized cap contribution in USD: `price_floor * supply`.
    pub realized_cap: Dollars,
    /// Unrealized P&L in USD against the close on the snapshot date: `(close - price_floor) * supply`. Can be negative.
    pub unrealized_pnl: Dollars,
}