volumediscount

package
v0.75.0-preview.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MaximumWindowLength uint64 = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker interface {
	Send(events.Event)
}

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func New

func New(broker Broker, marketActivityTracker MarketActivityTracker) *Engine

func (*Engine) HasProgramEnded

func (e *Engine) HasProgramEnded() bool

func (*Engine) OnEpoch

func (e *Engine) OnEpoch(ctx context.Context, ep types.Epoch)

func (*Engine) OnEpochRestore

func (e *Engine) OnEpochRestore(_ context.Context, ep types.Epoch)

func (*Engine) TakerNotionalForParty

func (e *Engine) TakerNotionalForParty(party types.PartyID) num.Decimal

func (*Engine) UpdateProgram

func (e *Engine) UpdateProgram(newProgram *types.VolumeDiscountProgram)

func (*Engine) VolumeDiscountFactorForParty

func (e *Engine) VolumeDiscountFactorForParty(party types.PartyID) num.Decimal

type MarketActivityTracker

type MarketActivityTracker interface {
	NotionalTakerVolumeForAllParties() map[types.PartyID]*num.Uint
}

type SnapshottedEngine

type SnapshottedEngine struct {
	*Engine
	// contains filtered or unexported fields
}

func NewSnapshottedEngine

func NewSnapshottedEngine(broker Broker, mat MarketActivityTracker) *SnapshottedEngine

func (*SnapshottedEngine) GetState

func (e *SnapshottedEngine) GetState(k string) ([]byte, []types.StateProvider, error)

func (*SnapshottedEngine) Keys

func (e *SnapshottedEngine) Keys() []string

func (*SnapshottedEngine) LoadState

func (*SnapshottedEngine) Namespace

func (e *SnapshottedEngine) Namespace() types.SnapshotNamespace

func (*SnapshottedEngine) Stopped

func (e *SnapshottedEngine) Stopped() bool

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL