Versions in this module Expand all Collapse all v0 v0.1.2 Aug 24, 2026 Changes in this version + const FeeRateDenominator + const FeeRateNumerator + const JournalCap + var ErrDuplicateOrder = errors.New("client_order_id already filled") + var ErrInsufficientBook = errors.New("displayed book size does not cover the requested count") + var ErrInsufficientCash = errors.New("paper balance insufficient") + var ErrInvalidInput = errors.New("invalid price or count") + var ErrJournalFull = errors.New("fill journal reached its configured cap") + var ErrNoRestingOrder = errors.New("no resting order to cancel") + func Fee(priceDollars string, countFP string) (string, error) + type Fill struct + At time.Time + BookHash string + ClientOrderID string + CountFP string + FeeDollars string + PriceDollars string + Side Side + Simulated bool + Ticker string + type FillRequest struct + BookHash string + BookPrice string + BookSizeFP string + ClientOrderID string + CountFP string + PriceDollars string + Side Side + Ticker string + type FillResult struct + CashAfter string + Fill *Fill + Replayed bool + type Ledger struct + func New(startCashDollars string) (*Ledger, error) + func (l *Ledger) Execute(req FillRequest) (*FillResult, error) + func (l *Ledger) Snapshot() (cash string, positions []Position, journal []Fill) + type Money struct + Scale int + Value *big.Int + func NewMoney(value string, scale int) (*Money, error) + func (m *Money) Add(o *Money, scale int) *Money + func (m *Money) Mul(o *Money, outScale int) *Money + func (m *Money) Render() string + func (m *Money) Sub(o *Money, scale int) *Money + func (m *Money) ValueSign() *Money + type Position struct + Ticker string + YesFP string + type Side string + const Ask + const Bid