和顺 / 衡律 返回所属 Agent
13.4

现金余额与净资产计量

原能力

按币种计量现金、持仓和净资产,说明估值、汇率及缺失范围。(合同附件 R7 13.4)

首选项目

Formance Ledger(MIT)。 Formance Ledger

匹配范围

账户余额及折现数值用于计量输入。

源码

Formance Ledger · func (s *Server) handleGetAccount(

internal/adapter/http/handlers_get_account.go · 12–25 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
func (s *Server) handleGetAccount(w http.ResponseWriter, r *http.Request) {
	ledgerName, ok := requireLedgerName(w, r)
	if !ok {
		return
	}

	address, ok := requirePathParameter(w, r, "address", "account address")
	if !ok {
		return
	}

	// Verify ledger exists
	_, err := s.backend.GetLedgerByName(r.Context(), ledgerName)
	if err != nil {

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

实现与验收要点

净资产定义、估值时点、权威币种和未结义务。