# Functions
IsValidString checks to see if the supplied string is a valid margin type.
StringToMarginType converts a string to a margin type doesn't error, just returns unknown if the string is not recognised.
# Constants
Isolated means a margin trade is isolated from other margin trades.
Multi means a margin trade is not isolated from other margin trades it can sometimes be referred to as "cross".
NoMargin indicates a trade that is conducted in non-margin mode, i.e., no borrowing of funds is involved.
SpotIsolated indicates a margin shared amongst all spot trades but isolated from other assets.
Unknown indicates the margin type is set, but unknown.
Unset is the default value.
# Variables
ErrInvalidMarginType returned when the margin type is invalid.
ErrMarginTypeUnsupported returned when the margin type is unsupported.
ErrNewAllocatedMarginRequired returned when the new allocated margin is missing and is required.
ErrOriginalPositionMarginRequired is returned when original position margin is empty and is required.
# Structs
BorrowCost contains the borrow rate costs.
LendingPayment contains a lending rate payment.
PositionChangeRequest used for wrapper functions to change margin fields for a position.
PositionChangeResponse holds response data for margin change requests.
Rate has the funding rate details and optionally the borrow rate.
RateHistoryRequest is used to request a funding rate.
RateHistoryResponse has the funding rate details.
# Type aliases
Type defines the different margin types supported by exchanges.