corda / net.corda.finance.contracts

Package net.corda.finance.contracts

Various types for common financial concepts like day roll conventions, fixes, etc.

WARNING: NOT API STABLE.

Types

AccrualAdjustment

enum class AccrualAdjustment

Simple enum for returning accurals adjusted or unadjusted. We don't actually do anything with this yet though, so it's ignored for now.

BilateralNettableState

interface BilateralNettableState<N : BilateralNettableState<N>>

Interface for state objects that support being netted with other state objects.

BusinessCalendar

open class BusinessCalendar

A business calendar performs date calculations that take into account national holidays and weekends. This is a typical feature of financial contracts, in which a business may not want a payment event to fall on a day when no staff are around to handle problems.

CommercialPaper

class CommercialPaper : Contract

Commodity

data class Commodity : TokenizableAssetInfo

Class representing a commodity, as an equivalent to the Currency class. This exists purely to enable the CommodityContract contract, and is likely to change in future.

DateRollConvention

enum class DateRollConvention

This reflects what happens if a date on which a business event is supposed to happen actually falls upon a non-working day. Depending on the accounting requirement, we can move forward until we get to a business day, or backwards. There are some additional rules which are explained in the individual cases below.

DateRollDirection

enum class DateRollDirection

This is utilised in the DateRollConvention class to determine which way we should initially step when finding a business day.

DayCountBasisDay

enum class DayCountBasisDay

This forms the day part of the "Day Count Basis" used for interest calculation. Note that the first character cannot be a number (enum naming constraints), so we drop that in the toString lest some people get confused.

DayCountBasisYear

enum class DayCountBasisYear

This forms the year part of the "Day Count Basis" used for interest calculation.

DealState

interface DealState : LinearState

Interface representing an agreement that exposes various attributes that are common. Implementing it simplifies implementation of general flows that manipulate many agreement types.

Expression

data class Expression

Represents a textual expression of e.g. a formula

ExpressionDeserializer

object ExpressionDeserializer : JsonDeserializer<Expression>

ExpressionSerializer

object ExpressionSerializer : JsonSerializer<Expression>

Fix

data class Fix : CommandData

A Fix represents a named interest rate, on a given day, for a given duration. It can be embedded in a tx.

FixOf

data class FixOf

A FixOf identifies the question side of a fix: what day, tenor and type of fix ("LIBOR", "EURIBOR" etc)

FixableDealState

interface FixableDealState : DealState

Interface adding fixing specific methods.

Frequency

enum class Frequency

Frequency at which an event occurs - the enumerator also casts to an integer specifying the number of times per year that would divide into (eg annually = 1, semiannual = 2, monthly = 12 etc).

MultilateralNettableState

interface MultilateralNettableState<out T : Any>

Interface for state objects that support being netted with other state objects.

NetCommand

interface NetCommand : CommandData

A common netting command for contracts whose states can be netted.

NetType

enum class NetType

Enum for the types of netting that can be applied to state objects. Exact behaviour for each type of netting is left to the contract to determine.

NettableState

interface NettableState<N : BilateralNettableState<N>, out T : Any> : BilateralNettableState<N>, MultilateralNettableState<T>

PaymentRule

enum class PaymentRule

Whether the payment should be made before the due date, or after it.

Tenor

data class Tenor

Placeholder class for the Tenor datatype - which is a standardised duration of time until maturity

Properties

CP_PROGRAM_ID

val CP_PROGRAM_ID: String

This is an ultra-trivial implementation of commercial paper, which is essentially a simpler version of a corporate bond. It can be seen as a company-specific currency. A company issues CP with a particular face value, say $100, but sells it for less, say $90. The paper can be redeemed for cash at a given date in the future. Thus this example would have a 10% interest rate with a single repayment. Commercial paper is often rolled over (the maturity date is adjusted as if the paper was redeemed and immediately repurchased, but without having to front the cash).

Functions

getCashBalance

fun CordaRPCOps.getCashBalance(currency: Currency): Amount<Currency>
fun ServiceHub.getCashBalance(currency: Currency): Amount<Currency>

getCashBalances

fun CordaRPCOps.getCashBalances(): Map<Currency, Amount<Currency>>
fun ServiceHub.getCashBalances(): Map<Currency, Amount<Currency>>