Module: float_swap_leg_entry
Expand source code
# Copyright (C) 2023-present The Project Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from dataclasses import dataclass
from typing_extensions import Self
from cl.runtime import Context
from cl.convince.entries.entry_key import EntryKey
from cl.tradeentry.entries.rates.swaps.rates_swap_leg_entry import RatesSwapLegEntry
@dataclass(slots=True, kw_only=True)
class FloatSwapLegEntry(RatesSwapLegEntry):
"""A series of interest rate payments with a floating coupon based on an interest rate index.."""
float_freq: str | None = None
"""Frequency at which floating interest accrues."""
float_index: EntryKey | None = None
"""Floating interest rate index ('float_spread' is added to the index fixing)."""
float_spread: EntryKey | None = None
"""Spread over the interest rate index (zero if not specified)."""
Classes
class FloatSwapLegEntry (*, entry_id: str = None, title: str = None, body: str | None = None, data: str | None = None, approved_by: UserKey | None = None, few_shot: bool | None = None, leg: RatesLegKey = None, pay_receive: EntryKey | None = None, effective_date: EntryKey | None = None, maturity_date: EntryKey | None = None, pay_freq: EntryKey | None = None, float_freq: str | None = None, float_index: EntryKey | None = None, float_spread: EntryKey | None = None)
-
A series of interest rate payments with a floating coupon based on an interest rate index..
Expand source code
@dataclass(slots=True, kw_only=True) class FloatSwapLegEntry(RatesSwapLegEntry): """A series of interest rate payments with a floating coupon based on an interest rate index..""" float_freq: str | None = None """Frequency at which floating interest accrues.""" float_index: EntryKey | None = None """Floating interest rate index ('float_spread' is added to the index fixing).""" float_spread: EntryKey | None = None """Spread over the interest rate index (zero if not specified)."""
Ancestors
- RatesSwapLegEntry
- RatesLegEntry
- Entry
- EntryKey
- KeyMixin
- RecordMixin
- abc.ABC
- typing.Generic
Static methods
def check_entry_id(entry_id: str) -> None
-
Inherited from:
RatesSwapLegEntry
.check_entry_id
Check that the unique identifier is compliant with the expected format.
def get_entry_id(record_type: str, title: str, body: str | None = None, data: str | None = None) -> str
-
Inherited from:
RatesSwapLegEntry
.get_entry_id
Create the unique identifier from parameters.
def get_key_type() -> Type
-
Inherited from:
RatesSwapLegEntry
.get_key_type
Return key type even when called from a record.
def parse_optional_bool(field_value: str | None, *, field_name: str | None = None) -> bool | None
-
Inherited from:
RatesSwapLegEntry
.parse_optional_bool
Parse an optional boolean value.
def parse_required_bool(field_value: str | None, *, field_name: str | None = None) -> bool
-
Inherited from:
RatesSwapLegEntry
.parse_required_bool
Parse an optional boolean value.
Fields
var approved_by -> UserKey | None
-
Inherited from:
RatesSwapLegEntry
.approved_by
User who recorded the approval.
var body -> str | None
-
Inherited from:
RatesSwapLegEntry
.body
Optional body of the entry if not completely described by the title (included in MD5 hash).
var data -> str | None
-
Inherited from:
RatesSwapLegEntry
.data
Optional supporting data in YAML format (included in MD5 hash).
var effective_date -> EntryKey | None
-
Inherited from:
RatesSwapLegEntry
.effective_date
Trade or leg effective date defined as unadjusted date or time interval relative to another date.
var entry_id -> str
-
Inherited from:
RatesSwapLegEntry
.entry_id
Based on record type, title and MD5 hash of body and data if present, EntryUtil.create_id is used to generate.
var few_shot -> bool | None
-
Inherited from:
RatesSwapLegEntry
.few_shot
If True, use this entry as a few-shot example.
var float_freq -> str | None
-
Frequency at which floating interest accrues.
var float_index -> EntryKey | None
-
Floating interest rate index (‘float_spread’ is added to the index fixing).
var float_spread -> EntryKey | None
-
Spread over the interest rate index (zero if not specified).
var leg -> RatesLegKey
-
Inherited from:
RatesSwapLegEntry
.leg
Interest rate leg.
var maturity_date -> EntryKey | None
-
Inherited from:
RatesSwapLegEntry
.maturity_date
Trade or leg maturity date defined as unadjusted date or time interval relative to another date.
var pay_freq -> EntryKey | None
-
Inherited from:
RatesSwapLegEntry
.pay_freq
Payment frequency.
var pay_receive -> EntryKey | None
-
Inherited from:
RatesSwapLegEntry
.pay_receive
String representation of the Buy or Sell flag in the format specified by the user.
var title -> str
-
Inherited from:
RatesSwapLegEntry
.title
Title of a long entry or complete description of a short one (included in MD5 hash).
Methods
def get_key(self) -> EntryKey
-
Inherited from:
RatesSwapLegEntry
.get_key
Return a new key object whose fields populated from self, do not return self.
def get_text(self) -> str
-
Inherited from:
RatesSwapLegEntry
.get_text
Get the complete text of the entry.
def init(self) -> None
-
Inherited from:
RatesSwapLegEntry
.init
Generate entry_id in ‘type: title’ format followed by an MD5 hash of body and data if present.
def init_all(self) -> None
-
Inherited from:
RatesSwapLegEntry
.init_all
Invoke ‘init’ for each class in the order from base to derived, then validate against schema.
def run_propose(self) -> None
-
Inherited from:
RatesSwapLegEntry
.run_propose
Generate or regenerate the proposed value.