Skip to content

Commit 274c325

Browse files
remove used parameters
1 parent 1c8c5d3 commit 274c325

5 files changed

Lines changed: 8 additions & 82 deletions

File tree

docs/FUNDS_REVIEW_GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ These are the load-bearing review points — each is a *contract* fact, verified
8484
3. **No §12 auto-chunking.** The ~one-year span cap that chunking works around only applies to intraday candle requests. A multi-decade daily funds request is **one** HTTP request, on both the typed resource and the CSV facet (which is why `FundsCsvResource` has no `mergeCsvBodies` analogue). Test: `candlesLongDailyRangeIsASingleRequest`.
8585
4. **No `extended` parameter.** Extended-hours sessions only exist intraday; exposing the flag would be dead surface. (The backend's OpenAPI schema lists it because funds reuse the stock-candles schema helper, but it can never have an effect.)
8686

87-
Python-SDK parity note: `sdk-py` exposes `symbol/resolution/from/to/countback` only. This PR additionally exposes `date`, `exchange`, `country`, `adjustsplits`, `adjustdividends` — all accepted by the funds endpoint (shared candles serializer/handler) and all meaningful for daily-and-up fund series (CRSP split/dividend adjustment very much applies to funds).
87+
Python-SDK parity note: `sdk-py` exposes `symbol/resolution/from/to/countback` only. This PR additionally exposes `date` (a window shape the backend honors). It does **not** expose `exchange`, `country`, `adjustsplits`, `adjustdividends`: although the funds OpenAPI schema declares them (it reuses the shared candles serializer), the funds handler ignores `exchange`/`country` entirely and `adjustdividends` is commented out — only `adjustsplits` is read, and `sdk-py` does not surface it either, so all four were dropped for cross-language parity.
8888

8989
---
9090

@@ -94,7 +94,7 @@ One spec builder, `FundsResource.candlesSpec` (package-private static, reused by
9494

9595
| Endpoint | Path | Params |
9696
|---|---|---|
97-
| `candlesSpec` | `funds/candles/{resolution}/{symbol}` | `date`/`from`/`to`/`countback`, `exchange`, `country`, `adjustsplits`, `adjustdividends` |
97+
| `candlesSpec` | `funds/candles/{resolution}/{symbol}` | `date`/`from`/`to`/`countback` |
9898

9999
What to verify:
100100
- Path segments encoded via `PathSegments.encode` (resolution token too); dates ISO-formatted (`2025-01-17`).

examples/consumer-test/src/main/java/com/marketdata/consumer/FundsApp.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* <ul>
2020
* <li>the single endpoint ({@code candles}) with its full parameter surface — universal params
2121
* (dateFormat/mode/limit/offset) + the three window shapes ({@code from}/{@code to}, {@code
22-
* date}, {@code to}+{@code countback}) and the adjustment/exchange params;
22+
* date}, {@code to}+{@code countback});
2323
* <li>what funds do NOT have: no volume column (NAV series), no intraday resolutions (the API
2424
* rejects them), and therefore no §12 auto-chunking — a multi-decade daily range is one
2525
* request;
@@ -66,7 +66,7 @@ public static void main(String[] args) {
6666
private static void candlesWithParams(MockServerControl mock, MarketDataClient client) {
6767
Console.header("funds.candles — the parameter surface");
6868

69-
// from/to window + adjustment/exchange params + universal params, set fluently.
69+
// from/to window + universal params, set fluently.
7070
Console.step("candles(...) — daily OHLC + universal params (dateFormat/mode/limit)");
7171
mock.reset();
7272
mock.script(Step.of(200, CANDLES));
@@ -80,8 +80,6 @@ private static void candlesWithParams(MockServerControl mock, MarketDataClient c
8080
FundCandlesRequest.builder(FundResolution.DAILY, "VFINX") // required: resolution + symbol
8181
.from(LocalDate.of(2025, 1, 1))
8282
.to(LocalDate.of(2025, 1, 31))
83-
.adjustSplits(true)
84-
.adjustDividends(true)
8583
.build());
8684
List<FundCandle> bars = candles.values(); // List<FundCandle>
8785
Console.ok("candles.values() → " + bars.size() + " bars; iterating (note: no volume column):");

src/main/java/com/marketdata/sdk/FundsResource.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,6 @@ static RequestSpec.Builder candlesSpec(FundCandlesRequest r) {
153153
if (r.countback() != null) {
154154
b.query("countback", r.countback());
155155
}
156-
if (r.exchange() != null) {
157-
b.query("exchange", r.exchange());
158-
}
159-
if (r.country() != null) {
160-
b.query("country", r.country());
161-
}
162-
if (r.adjustSplits() != null) {
163-
b.query("adjustsplits", r.adjustSplits());
164-
}
165-
if (r.adjustDividends() != null) {
166-
b.query("adjustdividends", r.adjustDividends());
167-
}
168156
return b;
169157
}
170158

src/main/java/com/marketdata/sdk/funds/FundCandlesRequest.java

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
/**
88
* Parameters for {@code GET /v1/funds/candles/{resolution}/{symbol}/}. The {@link FundResolution}
9-
* and the fund's ticker {@code symbol} are required; the rest bound the window and tune
10-
* adjustment/exchange resolution.
9+
* and the fund's ticker {@code symbol} are required; the rest bound the window.
1110
*
1211
* <p>Window rules (enforced in {@link Builder#build()}): {@code date} selects a single trading day
1312
* and is incompatible with {@code from}/{@code to}/{@code countback}; {@code countback} pairs with
1413
* {@code to} (not {@code from}) and must be positive.
1514
*
1615
* <p>There is no {@code extended} parameter: extended-hours sessions only exist on intraday
17-
* candles, which the funds endpoint does not serve.
16+
* candles, which the funds endpoint does not serve. The funds endpoint also does not honor {@code
17+
* exchange}/{@code country}/{@code adjustsplits}/{@code adjustdividends}, so those are not exposed.
1818
*/
1919
public final class FundCandlesRequest {
2020

@@ -24,10 +24,6 @@ public final class FundCandlesRequest {
2424
private final @Nullable LocalDate from;
2525
private final @Nullable LocalDate to;
2626
private final @Nullable Integer countback;
27-
private final @Nullable String exchange;
28-
private final @Nullable String country;
29-
private final @Nullable Boolean adjustSplits;
30-
private final @Nullable Boolean adjustDividends;
3127

3228
private FundCandlesRequest(Builder b) {
3329
this.resolution = b.resolution;
@@ -36,10 +32,6 @@ private FundCandlesRequest(Builder b) {
3632
this.from = b.from;
3733
this.to = b.to;
3834
this.countback = b.countback;
39-
this.exchange = b.exchange;
40-
this.country = b.country;
41-
this.adjustSplits = b.adjustSplits;
42-
this.adjustDividends = b.adjustDividends;
4335
}
4436

4537
/** Shortcut for {@code builder(resolution, symbol).build()}. */
@@ -75,33 +67,13 @@ public String symbol() {
7567
return countback;
7668
}
7769

78-
public @Nullable String exchange() {
79-
return exchange;
80-
}
81-
82-
public @Nullable String country() {
83-
return country;
84-
}
85-
86-
public @Nullable Boolean adjustSplits() {
87-
return adjustSplits;
88-
}
89-
90-
public @Nullable Boolean adjustDividends() {
91-
return adjustDividends;
92-
}
93-
9470
public static final class Builder {
9571
private final FundResolution resolution;
9672
private final String symbol;
9773
private @Nullable LocalDate date;
9874
private @Nullable LocalDate from;
9975
private @Nullable LocalDate to;
10076
private @Nullable Integer countback;
101-
private @Nullable String exchange;
102-
private @Nullable String country;
103-
private @Nullable Boolean adjustSplits;
104-
private @Nullable Boolean adjustDividends;
10577

10678
private Builder(FundResolution resolution, String symbol) {
10779
this.resolution = Objects.requireNonNull(resolution, "resolution");
@@ -134,30 +106,6 @@ public Builder countback(int countback) {
134106
return this;
135107
}
136108

137-
/** Disambiguate the exchange (acronym, MIC code, or two-digit Yahoo code). */
138-
public Builder exchange(String exchange) {
139-
this.exchange = Objects.requireNonNull(exchange, "exchange");
140-
return this;
141-
}
142-
143-
/** Disambiguate the exchange country (two-digit ISO 3166 code). */
144-
public Builder country(String country) {
145-
this.country = Objects.requireNonNull(country, "country");
146-
return this;
147-
}
148-
149-
/** Adjust for splits and reverse splits (daily default true). */
150-
public Builder adjustSplits(boolean adjustSplits) {
151-
this.adjustSplits = adjustSplits;
152-
return this;
153-
}
154-
155-
/** Adjust for dividends (daily default true). */
156-
public Builder adjustDividends(boolean adjustDividends) {
157-
this.adjustDividends = adjustDividends;
158-
return this;
159-
}
160-
161109
public FundCandlesRequest build() {
162110
FundRequests.requireNonEmpty(symbol, "symbol");
163111
FundRequests.validateWindow(date, from, to, countback);

src/test/java/com/marketdata/sdk/FundsResourceTest.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,14 @@ void candlesAttachesAllParams() {
7979
FundCandlesRequest.builder(FundResolution.WEEKLY, "VFINX")
8080
.from(LocalDate.of(2025, Month.JANUARY, 1))
8181
.to(LocalDate.of(2025, Month.JANUARY, 31))
82-
.exchange("XNAS")
83-
.country("US")
84-
.adjustSplits(true)
85-
.adjustDividends(false)
8682
.build())
8783
.join();
8884

8985
String url = client.captured.get(0).uri().toString();
9086
assertThat(url)
9187
.contains("/v1/funds/candles/W/VFINX/")
9288
.contains("from=2025-01-01")
93-
.contains("to=2025-01-31")
94-
.contains("exchange=XNAS")
95-
.contains("country=US")
96-
.contains("adjustsplits=true")
97-
.contains("adjustdividends=false");
89+
.contains("to=2025-01-31");
9890
}
9991

10092
@Test

0 commit comments

Comments
 (0)