到期清算与投资退出
原能力
分别建立出售、赎回、到期、转让和回收路径,保留现实可执行条件。(合同附件 R7 18.8)
首选项目
QuantLib(Modified BSD,上游许可正文)。 QuantLib
匹配范围
现金流折现与分录支持到期和退出记录。
源码
QuantLib · CashFlows::npv(
ql/cashflows/cashflows.cpp · 420–433 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
Real CashFlows::npv(const Leg& leg,
const YieldTermStructure& discountCurve,
const std::optional<bool>& includeSettlementDateFlows,
Date settlementDate,
Date npvDate) {
if (leg.empty())
return 0.0;
if (settlementDate == Date())
settlementDate = Settings::instance().evaluationDate();
if (npvDate == Date())
npvDate = settlementDate;
- Copyright (C) 2005, 2006 StatPro Italia srl
- Copyright (C) 2005 Charles Whitmore
- Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Ferdinando Ametrano
- Copyright (C) 2008 Toyin Akin
Formance Ledger · func (s *Server) handleCreateTransaction(
internal/adapter/http/handlers_create_transaction.go · 13–26 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
func (s *Server) handleCreateTransaction(w http.ResponseWriter, r *http.Request) {
ledgerName, ok := requireLedgerName(w, r)
if !ok {
return
}
// Decode request body into protobuf CreateTransactionPayload.
// The custom UnmarshalJSON in service.pb.json.go drives field naming
// from the public camelCase contract (scriptReference, accountMetadata,
// …) — the default protoc-gen-go tags are snake_case and would silently
// drop multi-word keys (#452).
req := &servicepb.CreateTransactionPayload{}
err := json.UnmarshalRead(r.Body, req)
实现与验收要点
清算、法定权利实际兑现及合同批准。