Skip to main content

Module margin

Module margin 

Source
Expand description

Margin borrowing: the borrow and repay policy a margin account applies to its orders, the simulated venue’s spot margin configuration, and the interest it charges on its loans.

MarginSideEffect is the policy a live margin client sends with each order, and the one the simulated venue applies when SpotMarginConfig turns its spot margin on. A MarginInterestModel prices those loans over time; PeriodicMarginInterest is the built-in one.

Structs§

InterestCharge
One charge a MarginInterestModel makes on one loan.
PeriodicMarginInterest
Margin interest charged a period at a time, at an annualised rate per asset: a crypto margin account’s hourly interest.
SpotMarginConfig
Spot margin on the simulated venue: what it lends a spot order, how much, and what it repays.

Enums§

InterestDue
When a MarginInterestModel is asked to charge a loan.
InterestSchedule
When a PeriodicMarginInterest charges a loan.
MarginSideEffect
Whether a margin account borrows what an order lacks and repays its loans from what an order receives, fixed once per client or simulated venue.
SpotMarginConfigError
Why a SpotMarginConfig was refused.

Traits§

MarginInterestModel
Charges interest on a simulated margin loan: once when the loan is taken, and at boundaries in time while it stays open.