Solard

Architecture

Where Solard stops and application code begins.

Layers

LayerOwns
ApplicationPolicy, strategy, UI, servers, process topology.
@solard/sdkWallet, market, execution, history, payout capabilities.
@solard/coreProtocol decoding, persistence, transaction machinery.
SolanaAccounts, programs, RPC, WebSocket transport.

Public surface

SDK methods describe intent: buy(), subscribeTrades(), snapshotHolders(). Signers, repositories, raw layouts, and transport details stay below that boundary.

text
application:  buy this token
sdk:          route · build · sign · simulate · submit · confirm
core:         protocol and persistence details

Subscriptions

APIScopeCost of adding a token
subscribeLaunches()GlobalNone
subscribeMigrations()Global + local filterFilter update
subscribeTrades()Token-specificLogical Solana log subscription

A single Solana Connection can carry many logical subscriptions. Transport count and subscription count are different resource limits.

Enrichment

MetadataWork
falseDecoded event only.
"chain"Add on-chain identity data.
"full"Add external metadata when available.

Detection stays on the fast path. Metadata, transaction enrichment, pricing, and USD conversion are separate work.

Event semantics

RuleConsequence
Protocol truthA migration event means an observed migration, not a post-migration heuristic.
Facts, not policyThe SDK reports isMayhemMode; the application decides whether to ignore it.
Cache by lifetimeReuse identity metadata; do not treat high-frequency trades as identity cache data.

Security

Signing authority and secret export are separate capabilities. Solard can sign through a stored wallet without exposing the wallet secret. Application code should not widen the SDK surface by casting to internal signer types.

Execution

ModeMeaning
PaperApplication-side simulated fills.
SimulationBuild a real transaction and simulate it; do not broadcast.
LiveSign and broadcast.

Paper and live execution should be explicit application states, not interchangeable implementations behind the same hidden switch.

Providers

Discovery, runtime market data, and execution may use different providers. A search UI can use an external index while live trades and execution stay on Solard.

Configuration

text
UI → validation → stored state → worker → strategy → execution

A setting only exists operationally if it reaches the component that uses it.

Servers and examples

Ports, HTTP routes, auth, client protocols, backpressure, and process topology belong to applications. Examples compose SDK primitives to show connection ownership, dynamic token sets, and shutdown.