Table of Contents

Struct Position<A>

Namespace
Virtufin.Base
Assembly
Virtufin.Base.dll

A holding: an amount of some AssetIdentifier.

public readonly record struct Position<A> : IEquatable<Position<A>> where A : IFixedPointAmount<A>

Type Parameters

A

The fixed-point amount type measuring the holding — DecimalAmount for decimal instruments, BinaryAmount where a binary scale is the natural one.

Implements
Inherited Members

Remarks

The size carries its own precision, and precision is part of an amount's identity, so two positions in the same asset recorded at different precisions are not equal. Equality returns false for that rather than throwing, which is what lets a position sit in a dictionary or be compared by the generated equality of a record that holds one.

Constructors

Position(A, AssetIdentifier)

A holding: an amount of some AssetIdentifier.

public Position(A Size, AssetIdentifier AssetIdentifier)

Parameters

Size A

How much of the asset.

AssetIdentifier AssetIdentifier

Which asset.

Remarks

The size carries its own precision, and precision is part of an amount's identity, so two positions in the same asset recorded at different precisions are not equal. Equality returns false for that rather than throwing, which is what lets a position sit in a dictionary or be compared by the generated equality of a record that holds one.

Properties

AssetIdentifier

Which asset.

public AssetIdentifier AssetIdentifier { get; init; }

Property Value

AssetIdentifier

Size

How much of the asset.

public A Size { get; init; }

Property Value

A