Struct PyProductBuilder
pub struct PyProductBuilder {
inner: ProductBuilder,
code: String,
}Expand description
A swap draft: a template’s swap with every term defaulted — effective at the template’s spot from the trade date, ten years long, 10,000,000, receiving fixed — and no fixed rate until one is stated or struck at par.
Frozen: every with_* returns a new draft. Not an instrument: a draft has
no rate, and build says so rather than pricing a swap at 0%.
Fields§
§inner: ProductBuilder§code: StringImplementations§
§impl PyProductBuilder
impl PyProductBuilder
fn refined(&self, inner: ProductBuilder) -> Self
fn end_of(end: PyTermination) -> PyResult<Termination>
§impl PyProductBuilder
impl PyProductBuilder
fn with_notional(&self, notional: f64) -> Self
fn with_notional(&self, notional: f64) -> Self
This draft on notional.
fn with_fixed_rate(&self, fixed_rate: f64) -> Self
fn with_fixed_rate(&self, fixed_rate: f64) -> Self
This draft at fixed_rate.
fn with_side(&self, side: &str) -> PyResult<Self>
fn with_side(&self, side: &str) -> PyResult<Self>
This draft on side: "payer" pays fixed, "receiver" receives it.
fn with_discount_key(&self, key: &str) -> Self
fn with_discount_key(&self, key: &str) -> Self
This draft discounting on the raw key key — "USD-CSA-EUR", or a
named curve such as "CSA-ACME-2026" — overriding the family’s
default. The escape hatch: with_csa states a CSA, this a key. The
last stated wins between this, with_csa and with_counterparty.
fn with_csa(&self, csa: &str) -> PyResult<Self>
fn with_csa(&self, csa: &str) -> PyResult<Self>
This draft under the CSA csa: a collateral currency ("EUR") or the
CSA’s overnight index ("EUR-ESTR"), which names its currency.
with_csa("EUR") on a USD draft discounts on USD-CSA-EUR,
with_csa("USD") on the USD curve. The last stated wins.
fn with_counterparty(&self, counterparty: &PyCounterparty) -> Self
fn with_counterparty(&self, counterparty: &PyCounterparty) -> Self
This draft facing counterparty: collateralised under its CSA, so a
USD draft facing a EUR-CSA counterparty discounts on USD-CSA-EUR.
The collateral is the last stated between this and with_csa.
fn with_termination(&self, end: PyTermination) -> PyResult<Self>
fn with_termination(&self, end: PyTermination) -> PyResult<Self>
This draft ending at end: a date, or a forward tenor such as "5Y"
or "2Y2Y" read from the trade date and the template’s spot, as
vanilla_swap reads one. with_maturity is the same verb.
fn with_maturity(&self, end: PyTermination) -> PyResult<Self>
fn with_maturity(&self, end: PyTermination) -> PyResult<Self>
with_termination under the desk’s word: one verb, two spellings.
fn build(&self) -> PyResult<PyInstrument>
fn build(&self) -> PyResult<PyInstrument>
The instrument, at the rate stated. A draft with no rate raises
ValueError naming with_fixed_rate and at_par.
fn at_par(&self, py: Python<'_>, market: &PyMarket) -> PyResult<PyInstrument>
fn at_par(&self, py: Python<'_>, market: &PyMarket) -> PyResult<PyInstrument>
The instrument struck at the par rate market implies on the draft’s
own dates: worth zero on market to the par solve’s precision, and
carrying that rate as a number like any confirmed trade.
fn __repr__(&self) -> String
Trait Implementations§
§impl Clone for PyProductBuilder
impl Clone for PyProductBuilder
§fn clone(&self) -> PyProductBuilder
fn clone(&self) -> PyProductBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl DerefToPyAny for PyProductBuilder
§impl IntoPy<Py<PyAny>> for PyProductBuilder
impl IntoPy<Py<PyAny>> for PyProductBuilder
§impl PyClass for PyProductBuilder
impl PyClass for PyProductBuilder
§impl PyClassImpl for PyProductBuilder
impl PyClassImpl for PyProductBuilder
§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§type ThreadChecker = SendablePyClass<PyProductBuilder>
type ThreadChecker = SendablePyClass<PyProductBuilder>
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyProductBuilder
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyProductBuilder
§impl PyMethods<PyProductBuilder> for PyClassImplCollector<PyProductBuilder>
impl PyMethods<PyProductBuilder> for PyClassImplCollector<PyProductBuilder>
fn py_methods(self) -> &'static PyClassItems
§impl PyTypeInfo for PyProductBuilder
impl PyTypeInfo for PyProductBuilder
§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.