跳到主要内容
SignalPlusOS
登录
En简繁

AstroQuant

Deterministic financial dates, schedules, rates, FX, and credit

库

获取将在 SignalPlus OS 中打开,登录后即可安装。
评分
—
暂无评分
价格
免费
版本
1
2026年8月1日

关于这个库

AstroQuant

AstroQuant is a deterministic financial date engine for module apps. It covers business-day adjustment, schedules, day counts, FX value and option dates, deposits, FRA and STIR contracts, fixed/IBOR/OIS/basis/cross-currency legs, CDS and credit-index schedules, and user-supplied holiday calendars.

Interface

Call sp2_019fbe19_1e56_76fb_97aa_71725736f9fd_init() exactly once after the app initializes its Runtime context. It returns 0 on success.

sp2_019fbe19_1e56_76fb_97aa_71725736f9fd_call() accepts UTF-8 operation and request JSON slices and writes UTF-8 response JSON into a caller-owned buffer. A non-negative return value is the number of bytes written. Stable negative codes are:

  • -1: invalid pointer or UTF-8 input
  • -2: invalid operation or calculation request; a readable error is written when it fits
  • -3: output buffer too small

Supported operations are metadata, adjust_business_day, generate_schedule, calculate_day_count, generate_fx_option, generate_fx_spot, generate_fx_forward, fx_value_date, fx_trade_date, generate_cds_schedule, generate_credit_product, generate_rate_product, import_holiday_file, and clear_holiday_session.

The product operations return the versioned astroquant.date-workbench/v1 JSON contract. generate_credit_product and generate_rate_product accept { "tool_id": "...", "request": { ... } }, matching the Workbench request objects. Holiday import accepts { "file_name": "...", "bytes": [0, 1, ...], "support_from_year": 2020, "support_to_year": 2050, "activate": true } and supports XLSX, CSV, and JSON. Imported calendars remain process-local until clear_holiday_session is called.

Usage

Pin the exact published version from the SP2 registry and rename the UUID package locally:

[dependencies]
astroquant = { package = "sp2019f089b2fb074cbb283a6bfe576de90-019fbe19-1e56-76fb-97aa-71725736f9fd-sys", version = "=0.1.0", registry = "sp2-cargo" }
unsafe { astroquant::sp2_019fbe19_1e56_76fb_97aa_71725736f9fd_init() };

let operation = b"generate_fx_spot";
let request = br#"{"pair":"EURUSD","trade_date":"2026-08-03"}"#;
let mut output = vec![0_u8; 256 * 1024];
let written = unsafe {
    astroquant::sp2_019fbe19_1e56_76fb_97aa_71725736f9fd_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();

Versioning/Compatibility

Version 0.1.0 introduces ABI schema 1 and the astroquant.date-workbench/v1 response contract. Adding operations is backward compatible. Removing operations, changing error codes, or changing an exported C signature requires a 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.

新功能

版本 1 · 2026年8月1日

信息

类型
库
价格
免费
Remix
不开放 Remix
上架时间
2026年8月1日

同一开发者的更多作品