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§
- Interest
Charge - One charge a
MarginInterestModelmakes on one loan. - Periodic
Margin Interest - Margin interest charged a period at a time, at an annualised rate per asset: a crypto margin account’s hourly interest.
- Spot
Margin Config - Spot margin on the simulated venue: what it lends a spot order, how much, and what it repays.
Enums§
- Interest
Due - When a
MarginInterestModelis asked to charge a loan. - Interest
Schedule - When a
PeriodicMarginInterestcharges a loan. - Margin
Side Effect - 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.
- Spot
Margin Config Error - Why a
SpotMarginConfigwas refused.
Traits§
- Margin
Interest Model - Charges interest on a simulated margin loan: once when the loan is taken, and at boundaries in time while it stays open.