pub struct Portfolio {
pub wallet_address: WalletAddress,
pub positions: Vec<PositionWithMetrics>,
pub total_margin_used: Decimal,
pub available_balance: Decimal,
pub spot_available_usdc: Option<Decimal>,
pub withdrawable_usdc: Option<Decimal>,
pub portfolio_snapshot_timestamp_ms: Option<u64>,
pub span_margin: Option<SpanMarginSummary>,
pub margin_mode: String,
pub margin_summary: Option<MarginSummary>,
}Expand description
Full portfolio snapshot for a single account.
Fields§
§wallet_address: WalletAddressAccount wallet address (checksummed Ethereum address).
positions: Vec<PositionWithMetrics>All open positions with enriched risk metrics.
total_margin_used: DecimalTotal margin currently in use across all positions in USD. Serialized as a string.
available_balance: DecimalFree collateral available for new trades in USD. Serialized as a string.
spot_available_usdc: Option<Decimal>Free USDC under the spot-buy cash check, after financing and reservations. Null for standard margin or unavailable cash facts; not an order approval.
withdrawable_usdc: Option<Decimal>Reservation-netted Account.sol USDC capped by Hypercall withdrawal-admission margin headroom, then truncated toward zero to eight decimal places.
portfolio_snapshot_timestamp_ms: Option<u64>Source timestamp of the authoritative Hydromancer portfolio snapshot.
span_margin: Option<SpanMarginSummary>SPAN margin breakdown, present when the account uses portfolio margin.
margin_mode: StringMargin mode for this account ("standard" or "portfolio").
margin_summary: Option<MarginSummary>Unified margin summary, present when computed.
Implementations§
Source§impl Portfolio
impl Portfolio
pub fn margin_mode_kind(&self) -> Result<MarginMode, ParseSdkEnumError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Portfolio
impl<'de> Deserialize<'de> for Portfolio
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Portfolio, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Portfolio, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Portfolio
impl Serialize for Portfolio
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,
Auto Trait Implementations§
impl Forget for Portfolio
impl Freeze for Portfolio
impl Move for Portfolio
impl RefUnwindSafe for Portfolio
impl Send for Portfolio
impl Sync for Portfolio
impl Unpin for Portfolio
impl UnsafeUnpin for Portfolio
impl UnwindSafe for Portfolio
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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