Shared assessment
Describe verifiable reads and policies instead of adding vendor-specific risk contracts.
On this page
Shared components
| Component | Enforcement |
|---|---|
| Execution policy | Approved targets, selectors, argument constraints, native value and spend limits. |
| Read program | Bounded ABI queries and deterministic conversion into uniform state fields. |
| Value reader | Ownership, prices, liabilities, recovery costs and retained-value factors. |
| Recovery policy | Ordered exit phases, spend bounds, receipt protection and completion checks. |
| Implementation guard | The admitted target and implementation code identities. |
The developer configures these rules in the definition. The same deployed modules enforce them for each use case. Unsupported read or exit behavior needs platform work before admission; it does not become safe because the TypeScript object matches a type.
Assessment configuration
| Field | Define |
|---|---|
| read_program, state_target, reads | ABI programs for meta, positions, pending reconciliation and requests. |
| assets, markets | Asset decimals, oracle/feed, holding and exposure limits, quote programs and receipts. |
| retained_bps, recovery_costs | Conservative value retained and settlement-unit recovery costs. |
| max_positions, max_pending, max_requests | Portfolio bounds the reader and recovery loop can handle. |
| action_limits, calls | Per-action funding/exposure limits and exact/range/account/spend constraints. |
| recovery | Pending, request, position and holding-phase exit calls. |
| prices | Direction, amount, price scales, oracle deviation, slippage and authorization age. |
Build a read program
ReadProgramBuilder and compile_read_program are exported by the SDK. Programs make bounded static reads against pinned contracts. They cannot run arbitrary JavaScript onchain. The Kuru quote program checks market parameters, status and available bid depth before computing recoverable proceeds.
Prepare activation calls
import { prepare_use_case, prepare_atomic_spot } from "@termbook/sdk";
const options = {
client, registry, core, health_source, health_factory,
max_health_age: 90,
};
const prepared = exchange.definition.atomic_spot
? await prepare_atomic_spot(exchange.definition, {
...options,
max_slippage_bps: 50,
max_deviation_bps: 100,
max_authorization_age: 90,
})
: await prepare_use_case(exchange.definition, options);
const calls = prepared.calls;These SDK helpers prepare governance transactions; they do not make the author an administrator. Authorized activation must configure the readers, policies, recovery components and integration version before an app token becomes active.