Repository navigation
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds GADUIN (gaduin.com) as a read-only venue.
What GADUIN is
A prediction market on transport outcomes: flight delays, train punctuality, ship arrivals, and weekly ship counts through maritime chokepoints. Each market is priced by an automated market maker (
kind: LMSR) and publishes its outcomes with a current price per outcome. There is no order book. Markets are binary (yes/no) or multi-outcome (for exampleon_time/delayed/cancelled).Operator: Gaduin Inc. (Panama). GADUIN is not licensed by any regulator and is not available to US persons.
What the adapter supports
Everything reads GADUIN's public read API (
https://gaduin.com/api/v1, OpenAPI athttps://gaduin.com/.well-known/openapi.json):fetchMarkets: lists up to 100 markets per call (GADUIN refuses larger pages for API-key reads).statusmaps as follows:active(the default) →OPEN,closed/inactive→CLOSED+SETTLED,all→ no filter.categoryisFLIGHT,TRAINorSHIPand goes through the base client-side filter.querymatches the question text of the fetched page, because the API has no server-side search.fetchMarket: looks up bymarketId(UUID),slugoroutcomeIdthroughGET /markets/{id}. A 404 becomesMarketNotFound.fetchOHLCV:GET /markets/{id}/price-historyreturns the outcome prices after each trade (up to 180 points). The adapter buckets those points into candles for any<n>m|h|dresolution and honoursstart/end/limit.volumeis left unset.<marketId>:<outcome idx>, the label is GADUIN's own, and the price comes fromprices[idx].yes/noaccessors are set only when the two outcomes are literallyyesandno. Multi-outcome markets get no YES/NO mapping, and labels are never rewritten.statusisactiveforOPEN; otherwise it is the lowercased venue status (closed,settled,cancelled,disputed).sourceMetadatacarrieskind,tradable,tradingClosesAtandsettledOutcomeIdx.What the adapter does not support
volume24handliquidityare0. Prices arenullonCANCELLED/DISPUTEDmarkets, so outcomes there report0.Authentication
Every REST read, market data included, needs a read-only GADUIN API key (
pk_live_…, minted at https://gaduin.com/account/ai; see https://gaduin.com/auth.md). Pass{ apiKey }(envGADUIN_API_KEY).GaduinAuthexchanges the key for a short-lived JWT atPOST /auth/tokenand caches it until a minute beforeexpires_in. Without a key, every read throwsAuthenticationErrorwith a pointer to where keys are minted. This follows the Metaculus pattern, where a token is also required for reads. No credential is embedded anywhere.Files
core/specs/gaduin/gaduin.yaml: GADUIN's published OpenAPI document. The only change is thatoperationIds are added. The published spec has none, and/marketsand/markets/{id}would both auto-name togetMarkets.api.tsis generated from it vianpm run fetch:openapi, andfetch-openapi-specs.jshas the new entry.core/src/exchanges/gaduin/:api.ts,auth.ts,errors.ts,utils.ts,fetchMarkets.ts,fetchOHLCV.ts,index.ts.ADDING_AN_EXCHANGE.mdand the Hunch PR:core/src/index.ts,server/app.ts,server/exchange-factory.ts,generate-openapi.js(instance + enum) →openapi.yaml,generate-compliance.js→COMPLIANCE.md(plusGADUIN_API_KEYin the env section),generate-python-exchanges.js→_exchanges.py/__init__.py, TS SDKclient.ts/index.ts, Mintlify venue label →venues.mdx, llms docs (including "12 → 13 more venues"), and the README venue strip.core/test/exchanges/gaduin.test.tsruns 7 tests against fixtures built from the documented response shapes, with an axios adapter mock and no live calls. They cover the key → token exchange (once, JSON body, Bearer header), list params and status mapping, the page cap, the category filter, faithful binary and multi-outcome mapping, the cancelled-market null-price case, lookup by id/slug with 404 →MarketNotFound, OHLCV bucketing (unordered input,limit), and validation errors. The venue lists in the existing docs tests also include GADUIN now.Verification (local)
npm run build --workspace=pmxt-core: pass.npx jest -c jest.config.jsincore: 52 suites passed, 1 skipped (829 passed, 3 skipped).node core/scripts/check-exchange-drift.js: no drift, 18 exchanges present in every layer.generate:openapigenerators all regenerate to the committed files.AuthenticationError, and an invalid key gets401 invalid api keyfrom the token endpoint. The same two checks through the sidecar routePOST /api/gaduin/fetchMarketsreturn the unified 401 error envelope. A successful live read needs a GADUIN account key, which this PR does not include.Notes for maintainers
docs/api-reference/openapi.json: only the GADUIN hunks are committed. On currentmain, regenerating this file already produces a large unrelated diff (and a2.54.0 → 2.17.1version line), so the docs-sync check may report that pre-existing drift.npm run generate:sdk:allwas not run: the openapi-generator step needs Java, which this machine does not have. As in the Hunch PR, the generated SDK clients take no exchange enum, so nothing there should change.Update, 23 Nov
GET /healthzpublicly, soGetHealthzis gone from the vendored spec and the generatedapi.ts. Nothing in the adapter called it./marketslimitmaximum is 100,/markets/{id}/activitylimitis bounded at 500, and the activity and price-history responses documenttruncated/starts_at.api.tsis byte-identical below its header to whatnpm run fetch:openapiwrites;test/exchanges/gaduin.test.tspasses (7 tests).Disclosure: I work on GADUIN. This was prepared with an AI coding agent on the maintainer's behalf.