brk_types 0.3.0-beta.9

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 {
    /// Lower bound of the bucket, in USD. Equals the exact realized price for `Raw`.
    pub price_floor: Dollars,
    /// Supply held with a last-move price inside this bucket, in BTC.
    pub supply: Bitcoin,
    /// Realized cap contribution in USD: sum of `realized_price * supply` over the coins in this bucket.
    pub realized_cap: Dollars,
    /// Unrealized P&L in USD against the close on the snapshot date: `close * supply - realized_cap`. Can be negative.
    pub unrealized_pnl: Dollars,
}