Class PositionTransferContract
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
positionPositionfromSignatorytoSignatoryatTimeStampidContractIdentifier
Properties
At
The settlement time.
public TimeStamp At { get; }
Property Value
From
The transferring party.
public Signatory From { get; }
Property Value
Id
public ContractIdentifier Id { get; }
Property Value
Position
The position being transferred.
public Position Position { get; }
Property Value
To
The receiving party.
public Signatory To { get; }
Property Value
Methods
Equals(IContract?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(IContract? other)
Parameters
otherIContractAn object to compare with this object.
Returns
IsRelatedTransaction(ITransaction)
Returns true iff the transaction targets this contract.
public bool IsRelatedTransaction(ITransaction transaction)
Parameters
transactionITransactionCandidate transaction.
Returns
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
messagesIEnumerable<IMessage>Candidate messages arriving at this step.
scenarioHistoryIScenarioHistoryFull history of prior scenarios.