Architecture
Where Solard stops and application code begins.
Layers
| Layer | Owns |
|---|---|
| Application | Policy, strategy, UI, servers, process topology. |
@solard/sdk | Wallet, market, execution, history, payout capabilities. |
@solard/core | Protocol decoding, persistence, transaction machinery. |
| Solana | Accounts, programs, RPC, WebSocket transport. |
Public surface
SDK methods describe intent: buy(), subscribeTrades(), snapshotHolders(). Signers, repositories, raw layouts, and transport details stay below that boundary.
application: buy this token
sdk: route · build · sign · simulate · submit · confirm
core: protocol and persistence detailsSubscriptions
| API | Scope | Cost of adding a token |
|---|---|---|
subscribeLaunches() | Global | None |
subscribeMigrations() | Global + local filter | Filter update |
subscribeTrades() | Token-specific | Logical Solana log subscription |
A single Solana Connection can carry many logical subscriptions. Transport count and subscription count are different resource limits.
Enrichment
| Metadata | Work |
|---|---|
false | Decoded 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
| Rule | Consequence |
|---|---|
| Protocol truth | A migration event means an observed migration, not a post-migration heuristic. |
| Facts, not policy | The SDK reports isMayhemMode; the application decides whether to ignore it. |
| Cache by lifetime | Reuse 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
| Mode | Meaning |
|---|---|
| Paper | Application-side simulated fills. |
| Simulation | Build a real transaction and simulate it; do not broadcast. |
| Live | Sign 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
UI → validation → stored state → worker → strategy → executionA 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.