Struct Position<A>
A holding: an amount of some AssetIdentifier.
public readonly record struct Position<A> : IEquatable<Position<A>> where A : IFixedPointAmount<A>
Type Parameters
AThe fixed-point amount type measuring the holding — DecimalAmount for decimal instruments, BinaryAmount where a binary scale is the natural one.
- Implements
-
IEquatable<Position<A>>
- 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
SizeAHow much of the asset.
AssetIdentifierAssetIdentifierWhich 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
Size
How much of the asset.
public A Size { get; init; }
Property Value
- A