Skip to content

Commit 83f7e73

Browse files
committed
fix(quote): support ETFs with no netAssets (fixes #916)
1 parent 6cdb04f commit 83f7e73

File tree

5 files changed

+105
-3
lines changed

5 files changed

+105
-3
lines changed

src/modules/options.schema.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,6 @@
15011501
"language",
15021502
"market",
15031503
"marketState",
1504-
"netAssets",
15051504
"priceHint",
15061505
"quoteType",
15071506
"region",

src/modules/quote.schema.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,6 @@
14281428
"language",
14291429
"market",
14301430
"marketState",
1431-
"netAssets",
14321431
"priceHint",
14331432
"quoteType",
14341433
"region",

src/modules/quote.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe("quote", () => {
3535
"ZRC-USD", // Low cap crypto (#403)
3636
"SOHO", // "openInterest" prop (#445)
3737
"VWRL.L", // ETF with no dividendYield, expenseRatio (#914)
38+
"ZGLD.SW", // ETF with no netAssets (#916)
3839
],
3940
});
4041

src/modules/quote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export interface QuoteCurrency extends QuoteBase {
158158
export interface QuoteEtf extends QuoteBase {
159159
quoteType: "ETF";
160160
dividendYield?: number; // 0.54
161-
netAssets: number; // 328302690000
161+
netAssets?: number; // 328302690000
162162
netExpenseRatio?: number; // 0.2
163163
}
164164

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"request": {
3+
"url": "https://query2.finance.yahoo.com/v7/finance/quote?symbols=ZGLD.SW&crumb=haT3oykhHqZ",
4+
"method": "GET",
5+
"headers": {
6+
"cookie": "GUCS=AV78X-IQ; GUC=AQABCAFnsytn2UIgTASn&s=AQAAAEKG89vA&g=Z7HctQ; A3=d=AQABBKvcsWcCEIGLkyl67hr2YX7XekV46j4FEgABCAErs2fZZ_bPb2UB9qMAAAcIq9yxZ63aZoI&S=AQAAAtFJa---IoVh8DRgGhGzVr4; A1S=d=AQABBKvcsWcCEIGLkyl67hr2YX7XekV46j4FEgABCAErs2fZZ_bPb2UB9qMAAAcIq9yxZ63aZoI&S=AQAAAtFJa---IoVh8DRgGhGzVr4; EuConsent=CQM66kAQM66kAAOACBENBcFoAP_gAEPgACiQKptB9G7WTXFneXp2YPskOYUX0VBJ4MAwBgCBAcABzBIUIBwGVmAzJEyIICACGAIAIGBBIABtGAhAQEAAYIAFAABIAEgAIBAAIGAAACAAAABACAAAAAAAAAAQgEAXMBQgmAYEBFoIQUhAggAgAQAAAAAEAIgBCgQAEAAAQAAICAAIACgAAgAAAAAAAAAEAFAIEQAAIAECAotkdQAAAAAAAAAAAAQACAABAAAAAIKpgAkGpUQBFgSEhAIGEECAEQUBABQIAgAACBAAAATBAUIAwAVGAiAEAIAAAAAAAAACABAAABAAhAAEAAQIAAAAAIAAgAIBAAACAAAAAAAAAAAAAAAAAAAAAAAAAGIBAggAAABBAAQUAAAAAgAAAAAAAAAIgACAAAAAAAAAAAAAAIgAAAAAAAAAAAAAAAAAAIAAAAIAAAAgBEFgAAAAAAAAAAAAAACAABAAAAAIAAA; A1=d=AQABBKvcsWcCEIGLkyl67hr2YX7XekV46j4FEgABCAErs2fZZ_bPb2UB9qMAAAcIq9yxZ63aZoI&S=AQAAAtFJa---IoVh8DRgGhGzVr4",
7+
"user-agent": "@gadicc/yahoo-finance2/0.0.1 (+https://github.com/gadicc/node-yahoo-finance2)"
8+
}
9+
},
10+
"response": {
11+
"ok": true,
12+
"status": 200,
13+
"statusText": "OK",
14+
"headers": {
15+
"age": "1",
16+
"cache-control": "public, max-age=1, stale-while-revalidate=9",
17+
"content-length": "1801",
18+
"content-type": "application/json;charset=utf-8",
19+
"date": "Mon, 26 May 2025 01:49:55 GMT",
20+
"referrer-policy": "no-referrer-when-downgrade",
21+
"server": "ATS",
22+
"strict-transport-security": "max-age=31536000",
23+
"vary": "Origin,Accept-Encoding",
24+
"x-content-type-options": "nosniff",
25+
"x-envoy-decorator-operation": "finance-quote-api--mtls-production-sg3.finance-k8s:4080/*",
26+
"x-envoy-upstream-service-time": "4",
27+
"x-frame-options": "SAMEORIGIN",
28+
"x-xss-protection": "1; mode=block",
29+
"y-rid": "6t52vltk37i64"
30+
},
31+
"bodyJson": {
32+
"quoteResponse": {
33+
"result": [
34+
{
35+
"language": "en-US",
36+
"region": "US",
37+
"quoteType": "ETF",
38+
"typeDisp": "ETF",
39+
"quoteSourceName": "Delayed Quote",
40+
"triggerable": false,
41+
"customPriceAlertConfidence": "LOW",
42+
"currency": "CHF",
43+
"exchange": "EBS",
44+
"regularMarketChangePercent": 1.1966461,
45+
"regularMarketPrice": 820.3,
46+
"fiftyTwoWeekLowChange": 223.59998,
47+
"fiftyTwoWeekLowChangePercent": 0.3747276,
48+
"fiftyTwoWeekRange": "596.7 - 838.9",
49+
"fiftyTwoWeekHighChange": -18.600037,
50+
"fiftyTwoWeekHighChangePercent": -0.022171935,
51+
"fiftyTwoWeekLow": 596.7,
52+
"fiftyTwoWeekHigh": 838.9,
53+
"fiftyTwoWeekChangePercent": 27.892113,
54+
"dividendYield": 0,
55+
"ytdReturn": 14.61364,
56+
"trailingThreeMonthReturns": 6.16144,
57+
"trailingThreeMonthNavReturns": 6.16144,
58+
"fiftyDayAverage": 801.106,
59+
"fiftyDayAverageChange": 19.19397,
60+
"fiftyDayAverageChangePercent": 0.023959339,
61+
"twoHundredDayAverage": 730.076,
62+
"twoHundredDayAverageChange": 90.224,
63+
"twoHundredDayAverageChangePercent": 0.123581655,
64+
"sourceInterval": 15,
65+
"exchangeDataDelayedBy": 15,
66+
"tradeable": false,
67+
"cryptoTradeable": false,
68+
"shortName": "Swisscanto GOLD ETF",
69+
"longName": "Swisscanto (CH) Gold ETF EA CHF",
70+
"hasPrePostMarketData": false,
71+
"firstTradeDateMilliseconds": 1199347200000,
72+
"priceHint": 2,
73+
"regularMarketChange": 9.700012,
74+
"regularMarketDayHigh": 822,
75+
"regularMarketDayRange": "809.0 - 822.0",
76+
"regularMarketDayLow": 809,
77+
"regularMarketVolume": 5484,
78+
"regularMarketPreviousClose": 810.6,
79+
"bid": 805.3,
80+
"ask": 822.1,
81+
"bidSize": 0,
82+
"askSize": 0,
83+
"fullExchangeName": "Swiss",
84+
"regularMarketOpen": 817.8,
85+
"averageDailyVolume3Month": 20289,
86+
"averageDailyVolume10Day": 11162,
87+
"marketState": "PREPRE",
88+
"corporateActions": [],
89+
"regularMarketTime": 1748014574,
90+
"messageBoardId": "finmb_53977340",
91+
"exchangeTimezoneName": "Europe/Zurich",
92+
"exchangeTimezoneShortName": "CEST",
93+
"gmtOffSetMilliseconds": 7200000,
94+
"market": "ch_market",
95+
"esgPopulated": false,
96+
"symbol": "ZGLD.SW"
97+
}
98+
],
99+
"error": null
100+
}
101+
}
102+
}
103+
}

0 commit comments

Comments
 (0)