Language

Choose a language

/build/rpc / pricing / market

pricing.market.calibrate

pricing.market.calibrate ( "source" max_age_hours decay_tau min_volume ) Calibrate market data (FX, curves, vol surfaces) from bulletin board offers Implements volume-weighted averaging with time decay as specified in PRICING&VALUATION.md §12 Arguments: 1. source (string, optional, default="nostr") Data source: 'nostr' (bulletin board) 2. max_age_hours (numeric, optional, default=24) Maximum age of offers to include (hours) 3. decay_tau (numeric, optional, default=6) Time decay constant (hours) 4. min_volume (numeric, optional, default=0) Minimum volume threshold to include offer Result: { (json object) "success" : true|false, (boolean) Whether calibration succeeded "offers_fetched" : n, (numeric) Total offers fetched from source "offers_parsed" : n, (numeric) Offers successfully parsed and included "spot_offers" : n, (numeric) Number of spot offers processed "repo_offers" : n, (numeric) Number of repo offers processed "forward_offers" : n, (numeric) Number of forward offers processed "fx_quotes_pushed" : n, (numeric) FX quotes added to pricing context "curves_pushed" : n, (numeric) Discount curves added to pricing context "vol_surfaces_pushed" : n, (numeric) Vol surfaces added to pricing context "warnings" : [ (json array) Calibration warnings { (json object) "severity" : "str", (string) info|warning|critical "category" : "str", (string) coverage|deadline|market_data|model|im|fx|interpolation "message" : "str" (string) Warning message }, ... ] } Examples: > bitcoin-cli pricing.market.calibrate "nostr" > bitcoin-cli pricing.market.calibrate "nostr" 12 3 10000 > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "pricing.market.calibrate", "params": ["nostr", 24, 6, 0]}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

pricing.market.calibrate(source?: string, max_age_hours?: number, decay_tau?: number, min_volume?: number) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"pricing.market.calibrate","params":["nostr",24,6,0]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
sourcestringData source: 'nostr' (bulletin board)
max_age_hoursnumberMaximum age of offers to include (hours)
decay_taunumberTime decay constant (hours)
min_volumenumberMinimum volume threshold to include offer

Result

Type:  any

{ (json object) "success" : true|false, (boolean) Whether calibration succeeded "offers_fetched" : n, (numeric) Total offers fetched from source "offers_parsed" : n, (numeric) Offers successfully parsed and included "spot_offers" : n, (numeric) Number of spot offers processed "repo_offers" : n, (numeric) Number of repo offers processed "forward_offers" : n, (numeric) Number of forward offers processed "fx_quotes_pushed" : n, (numeric) FX quotes added to pricing context "curves_pushed" : n, (numeric) Discount curves added to pricing context "vol_surfaces_pushed" : n, (numeric) Vol surfaces added to pricing context "warnings" : [ (json array) Calibration warnings { (json object) "severity" : "str", (string) info|warning|critical "category" : "str", (string) coverage|deadline|market_data|model|im|fx|interpolation "message" : "str" (string) Warning message }, ... ] }

Source: services/core-node/bcore/src/wallet/pricing/rpc/pricing_market.cpp:422

C++ symbol: pricing_market_calibrate