# Functions
IsValidCollateralModeString checks to see if the supplied string is a valid collateral mode.
StringToMode converts a string to a collateral mode doesn't error, just returns unknown if the string is not recognised.
# Constants
MultiMode has collateral allocated across the whole asset.
PortfolioMode has collateral allocated across account.
SingleMode has allocated collateral per position.
SpotFuturesMode has collateral allocated across spot and futures accounts.
UnknownMode has collateral allocated in an unknown manner at present, but is not unset.
UnsetMode is the default value.
# Variables
ErrInvalidCollateralMode is returned when converting invalid string to collateral mode.
# Structs
ByCurrency individual collateral contribution along with what the potentially scaled collateral currency it is represented as eg in Bybit ScaledCurrency is USDC.
ByPosition shows how much collateral is used from positions.
UsedBreakdown provides a detailed breakdown of where collateral is currently being allocated.
# Type aliases
Mode defines the different collateral types supported by exchanges For example, FTX had a global collateral pool Binance has either singular position collateral calculation or cross aka asset level collateral calculation.