Skip to content

Release: develop -> main#30

Merged
TaprootFreak merged 3 commits into
mainfrom
develop
May 12, 2026
Merged

Release: develop -> main#30
TaprootFreak merged 3 commits into
mainfrom
develop

Conversation

@github-actions

@github-actions github-actions Bot commented May 7, 2026

Copy link
Copy Markdown

Automatic Release PR

This PR was automatically created after changes were pushed to develop.

Commits: 1 new commit(s)

Checklist

  • Review all changes
  • Verify CI passes
  • Approve and merge when ready for production

Introduces a minimal footer with a "Get alerts" Telegram link. Bot URLs
(mainnet/testnet x prd/dev = 4 bots) live as code config in
frontend/src/constants.ts. The chain is resolved at runtime from
window.location.hostname (testnet domains -> testnet, else mainnet).
The prd/dev split is baked into each image at build time via Docker
build-args, with strict validation on VITE_DEPLOYMENT_ENV (no fallback).

- frontend-dev.yaml (:beta on develop) -> VITE_DEPLOYMENT_ENV=dev
- frontend-prd.yaml (:latest on main)  -> VITE_DEPLOYMENT_ENV=prd
…tchdogs (#31)

* Route CoinGecko via Pro endpoint with proxy support and add health watchdogs

The price service was sending Pro keys to api.coingecko.com with the
demo header, so CoinGecko counted the calls against the anonymous
IP-shared quota and routinely returned 429 (~47% of BTC fetches per day).
WCBTC suspicious-liq-price detection silently degraded whenever the BTC
spot cache went stale.

- COINGECKO_BASE_URL env var lets a service be pointed at a caching
  pricing proxy that injects the upstream key itself; otherwise a Pro
  key in COINGECKO_API_KEY now correctly routes to pro-api.coingecko.com
  with x-cg-pro-api-key.
- @Cron hourly staleness watchdog: if BTC spot has not refreshed for
  60 min, raise a critical Telegram alert (re-arms every 6 h while the
  condition persists, clears on the next successful fetch).
- @Cron daily quota probe of /api/v3/key: alert when the Pro account's
  monthly remaining call credit drops below 25k, so the account does
  not silently run dry.

* Close two staleness/quota gaps in pricing watchdogs

- btcLastSuccessMs now seeds with Date.now() at construction. With the
  earlier `null` default, a container that started while CoinGecko was
  down would never raise the staleness alert: the cron returned early on
  `null` and the gate could only open after a first success that wasn't
  arriving.
- checkCoingeckoQuota now routes through resolveCoingeckoEndpoint(), so
  a proxy-mode deployment (no local API key, key held by the proxy) is
  still covered. The previous `if (!apiKey) return` silently skipped
  the daily probe in exactly the configuration this PR was meant to roll
  out, leaving no signal when the Pro account approaches exhaustion.
- Single Date.now() per success path on the BTC fetch so the cache
  timestamp and the staleness anchor stay aligned.

* Refuse to start without a CoinGecko config instead of falling back

The resolver previously returned \`https://api.coingecko.com\`
(anonymous public host) when neither COINGECKO_BASE_URL nor
COINGECKO_API_KEY was set. That is a silent fallback and exactly the
shape \"no fallbacks\" is meant to prevent: a misconfigured service
would happily come up, route every call through the IP-shared
anonymous quota, and surface only later as sporadic 429s.

The constructor now throws when both env vars are empty, and the
resolver no longer carries an unauthenticated branch. The only two
remaining paths are the explicit proxy origin and direct Pro.

* Drop the direct-Pro code path; everything goes via pricing-proxy

COINGECKO_API_KEY is no longer read by this service. The proxy stack
holds the upstream key. The resolver now has a single path
(`COINGECKO_BASE_URL` only) and the constructor refuses to start
without it. No more two-branch logic, no more dead code.

* Make COINGECKO_API_KEY orthogonal: optional header, never a fallback

Operators without a pricing-proxy can now point COINGECKO_BASE_URL at
pro-api.coingecko.com directly and supply COINGECKO_API_KEY — the key
is attached as the x-cg-pro-api-key header on every request when set,
no two-branch logic, no fallback. In the DFX setup COINGECKO_API_KEY
stays unset because the proxy injects its own key.

README documents the pattern and links the proxy reference
implementation at github.com/DFXswiss/pricing-proxy.
#32)

`findActiveWithChallengePeriod` selects `size` and `current_price` from
`challenge_states`, both NUMERIC(78,0). Prisma's `$queryRaw` was
materialising the values as JS `number`, which loses precision for
values beyond 2^53 and serialises them via `.toString()` in scientific
notation (e.g. `2.8391...e+22`). `BigInt()` does not accept that
format, so the monitoring cycle crashed with
"Cannot convert <sci-notation> to a BigInt" on mainnet — JDM has
challenges over 28391.7 JUSD (28.4e21 wei), JDT does not, which is why
only JDM was affected.

Fix mirrors the pattern already used in `position.repository.ts`:
explicit `::text` casts in the SQL, typed as `string` in the row
shape, then `BigInt(r.size)` directly without an intermediate
`.toString()`.
@TaprootFreak TaprootFreak merged commit f4de8e0 into main May 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant