Skip to content

glacez-lib

Lane: backend · Repo: glacez/glacez-lib · Editing rules: Glacez/Libraries/glacez-lib/AGENTS.md

The platform's shared library: the domain models every service and webapp exchange, the factories that turn them into positions/orders/snapshots, and the clients that reach the venues. Five modules, one reactor, released together under one version.

Module Owns
glacez-lib-model ~104 domain classes: documents, quoted values, credential types, report hierarchy
glacez-lib-exception 7 runtime exceptions, each mapping to a response status in webservice
glacez-lib-utils static helpers — dates, numbers, formatting, instruments, addresses
glacez-lib-factory position/order/strategy/snapshot factories, condition evaluators, record synchronizers
glacez-lib-exchanges XChange clients (Binance, Bitstamp, Kraken, Kucoin), Etherscan wallet clients, record builders

The factory layer

glacez-lib-factory is the platform's deterministic core: it decides (replays transactions into positions, evaluates strategy conditions, generates orders) and it values (cost basis, market value, ROI, weights, snapshots). It fetches nothing and persists nothing. The full map, the inputs it expects and the position replay itself:

Why it matters beyond itself

exception → utils means every SOA has glacez-lib-utils on its classpath, so anything declared there is a platform-wide dependency. That is how a spring-boot-starter-data-rest once reached webservice and broke its documentation endpoint — a dependency decision here is an architectural decision.

The model also carries the annotation contract the whole platform depends on: Mongo @Id on 13 classes, @Document only on News, Jackson 2 annotations (com.fasterxml.jackson.annotation) that the SOAs feed to Jackson 3 databind. They are not to be "migrated": the annotations are the contract, the databind implementation is the consumer's choice.

Exchange clients

One client per credential type, four services each (account, records, trading, withdrawal), Etherscan for wallets. glacez-lib-exchanges is the only XChange consumer in the platform — see ADR-002. A new venue is a credential type, four implementations and one case.

Release coupling

Libraries release, never deploy: master builds 0-SNAPSHOT, and a merged change is not live anywhere. Every SOA and webapp pins a released version, so a lib fix reaches a consumer only after a release/X.Y release plus that consumer's own glacez.lib.version bump. Reporting a lib fix as deployed without that chain is wrong.

Jobs

None.