- 評分
- —
- 尚無評分
- 價格
- 免費
- 版本
- 2
- 2026年11月19日
- 開發者
- FinDate
關於這個函式庫
<!-- This README is the primary technical documentation shown on the Marketplace product page. The root icon-512.png is the identity image; buyers use this document to evaluate concrete interfaces. Every section below is required.
Crate naming conclusion (do not change package.name in Cargo.toml): package.name = "sp2019f089b2fb074cbb283a6bfe576de90-01a1ed9d-d0cc-76ec-8773-13087fd2524d-sys" sp2 — fixed prefix; cargo forbids names starting with a digit and SP2 org UUIDs (v7) always start with one. git-service strips it when parsing the owner segment. 019f089b2fb074cbb283a6bfe576de90 — org UUID (hyphens stripped). The crate name splits at its FIRST '-': everything before is the owner segment, which the platform maps back to the owning org. 01a1ed9d-d0cc-76ec-8773-13087fd2524d-sys — lib segment. 01a1ed9d-d0cc-76ec-8773-13087fd2524d is the creation UUID (== this repo name); git-service resolves "<uuid>(-sys)" lib segments to the creation id for vero CheckLibAccess (version-aware). The release pipeline fails any crate whose owner segment does not match the publishing repo owner. -->
FinDate
FinDate is a deterministic financial date engine for module apps. It covers business-day adjustment, schedules, day counts, FX spot, forward and option dates, deposits, FRA and STIR contracts, fixed/IBOR/OIS/basis/cross-currency/compounded legs, caps and swaptions, equity TRS, zero-coupon inflation and WTI average-price swaps, CDS and credit-index schedules, crypto expiry instants from supplied exchange snapshots, and user-supplied holiday calendars. It ships 70 QuantLib 1.37 calendars plus a CME/NYMEX 2026 settlement calendar, versioned rate-index and FX convention registries, and reference tables. It is pure compute: the consuming app supplies inputs (including any exchange metadata) and performs all side effects.
Interface
All functions use the C ABI (see include/01a1ed9d-d0cc-76ec-8773-13087fd2524d.h). Only scalars and pointers cross the boundary; requests and responses are UTF-8 JSON.
sp2_01a1ed9d_d0cc_76ec_8773_13087fd2524d_init() -> i32
Call exactly once from the consuming app's init() before any other function.
| Return | Meaning | | ------ | ------- | | 0 | success |
sp2_01a1ed9d_d0cc_76ec_8773_13087fd2524d_call(operation_ptr, operation_len, request_ptr, request_len, output_ptr, output_capacity) -> i32
Executes one operation. operation is a UTF-8 operation name and request is a UTF-8 JSON object (an empty request is treated as {}). The response is UTF-8 JSON written into the caller-owned output buffer.
| Return | Meaning | | ------ | ------- | | >= 0 | number of response bytes written | | -1 | invalid pointer or UTF-8 input | | -2 | invalid operation or calculation request; a readable error message is written when it fits | | -3 | output buffer too small |
Supported operations:
| Operation | Request | Response | | --------- | ------- | -------- | | metadata | {} | engine name/version, calendar catalog, FX conventions, supported tools | | adjust_business_day | { "date", "calendar", "convention", "end_of_month" } | findate.date-workbench/v1 | | generate_schedule | { "effective_date", "termination_date", "frequency", "calendar", "convention", "generation", "stub", "end_of_month", "first_regular_date"?, "next_to_last_regular_date"? } | findate.date-workbench/v1 | | calculate_day_count | { "start_date", "end_date", "convention", "calendar"?, "frequency"?, "reference_period_start"?, "reference_period_end"?, "is_termination_date"? } | findate.date-workbench/v1 | | generate_fx_spot / generate_fx_forward / generate_fx_option | { "pair", "trade_date", "tenor" } (tenor not used by spot) | findate.date-workbench/v1 | | fx_value_date / fx_trade_date | { "pair", "trade_date" } / { "pair", "value_date" } | ISO date string | | generate_cds_schedule | { "trade_date", "effective_date", "termination_date", "currency", "calendar"?, "schedule_kind", "settlement_lag" } | findate.date-workbench/v1 | | generate_credit_product / generate_rate_product / generate_extended_product | { "tool_id", "request": { ... } } | findate.date-workbench/v1 | | date_app_catalog | {} | Financial Dates tool catalog (28 tools, fields, defaults, calendars, rate lookup, reference tables), about 0.5 MB | | date_app_generate | { "tool_id", "request": { ... } } | metrics, timeline, tables, trace, warnings and calendar snapshots for any catalog tool | | import_holiday_file | { "file_name", "bytes": [0..255], "support_from_year", "support_to_year", "activate" } | import preview with calendar codes and holiday counts | | clear_holiday_session | {} | { "cleared": true } |
date_app_generate accepts every tool listed by date_app_catalog, for example business_day_convention ({ "input_date": "2026-01-31", "calendar": "USNY", "convention": "MF", "end_of_month_rule": false }), day_count, generic_schedule, fx_forward, ois, cap, equity_trs and crypto_option. Crypto tools never fetch data: the request must include exchange_metadata = { "exchange", "product", "fetched_at", "source", "contracts": [{ "underlying", "symbol", "expiry_ms" }] } obtained by the consuming app.
Holiday import supports XLSX, CSV and JSON. Imported calendars override matching codes and stay process-local until clear_holiday_session is called; apps serving several users should import and clear around each request.
Usage
Pin the exact published version from the SP2 registry and rename the UUID package locally:
[dependencies]
findate = { package = "sp2019f089b2fb074cbb283a6bfe576de90-01a1ed9d-d0cc-76ec-8773-13087fd2524d-sys", version = "=0.2.1", registry = "sp2-cargo" }unsafe { findate::sp2_01a1ed9d_d0cc_76ec_8773_13087fd2524d_init() };
let operation = b"generate_fx_spot";
let request = br#"{"pair":"EURUSD","trade_date":"2026-08-03"}"#;
let mut output = vec![0_u8; 1024 * 1024];
let written = unsafe {
findate::sp2_01a1ed9d_d0cc_76ec_8773_13087fd2524d_call(
operation.as_ptr(), operation.len() as u32,
request.as_ptr(), request.len() as u32,
output.as_mut_ptr(), output.len() as u32,
)
};
assert!(written >= 0);
let response = std::str::from_utf8(&output[..written as usize]).unwrap();Use an output buffer of at least 1 MB for date_app_catalog; other operations fit in 256 KB.
Versioning/Compatibility
Version 0.2.0, the first FinDate release, introduces ABI schema 1 and the findate.date-workbench/v1 response contract. Version 0.2.1 writes calendar and convention provenance as publisher names instead of web addresses; calculations, operations and signatures are unchanged. Adding operations or response fields is backward compatible. Removing an operation, changing an error code, or changing an exported C signature requires a new major version.
Pricing/Entitlement
Development, preview, and builds may use an SP2 trial bind. Deployment requires an active entitlement. Entitlement is per library; exact version pins preserve deterministic builds, and a higher-priced version may require paying the price difference.
新功能
版本 2 · 2026年11月19日
版本歷史
版本 1 · 2026年11月18日
資訊
- 開發者
- FinDate
- 類型
- 函式庫
- 價格
- 免費
- Remix
- 不開放 Remix
- 上架時間
- 2026年11月18日
使用這個函式庫的 App
同一開發者的更多作品
App 市場中的 App 由獨立開發者製作,上架前經 SignalPlus 審核;介紹文字由開發者提供。本站內容不構成投資建議,也不承諾收益。
