Table of Contents

Class PositionTransferContract

Namespace
Virtufin.Base
Assembly
Virtufin.Base.dll

A contract that transfers a Position from one Signatory to another at a fixed TimeStamp (its maturity).

public sealed record PositionTransferContract : IWithMaturity, IContract, IEquatable<IContract>, IEquatable<PositionTransferContract>
Inheritance
PositionTransferContract
Implements
Inherited Members

Examples

var from = Signatory.New();
var to = Signatory.New();
var pos = Position.Of(100, CurrencyIdentifier.USD);
var at = TimeStamp.New(2024, 12, 31);
var id = ContractIdentifier.NewWithUuid();
var contract = new PositionTransferContract(pos, from, to, at, id);

Constructors

PositionTransferContract(Position, Signatory, Signatory, TimeStamp, ContractIdentifier)

Construct a position-transfer contract.

public PositionTransferContract(Position position, Signatory from, Signatory to, TimeStamp at, ContractIdentifier id)

Parameters

position Position
from Signatory
to Signatory
at TimeStamp
id ContractIdentifier

Properties

At

The settlement time.

public TimeStamp At { get; }

Property Value

TimeStamp

From

The transferring party.

public Signatory From { get; }

Property Value

Signatory

Id

public ContractIdentifier Id { get; }

Property Value

ContractIdentifier

Position

The position being transferred.

public Position Position { get; }

Property Value

Position

To

The receiving party.

public Signatory To { get; }

Property Value

Signatory

Methods

Equals(IContract?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(IContract? other)

Parameters

other IContract

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

IsRelatedTransaction(ITransaction)

Returns true iff the transaction targets this contract.

public bool IsRelatedTransaction(ITransaction transaction)

Parameters

transaction ITransaction

Candidate transaction.

Returns

bool

VerifyMessages(IEnumerable<IMessage>, IScenarioHistory)

Validates the supplied messages against the contract and the prior scenario history, returning the subset of transactions deemed valid. Returns null when the input is invalid for this contract at the current time.

public IEnumerable<ITransaction>? VerifyMessages(IEnumerable<IMessage> messages, IScenarioHistory scenarioHistory)

Parameters

messages IEnumerable<IMessage>

Candidate messages arriving at this step.

scenarioHistory IScenarioHistory

Full history of prior scenarios.

Returns

IEnumerable<ITransaction>