DocsProtocol Architecture

System Overview

How the contracts, keeper, application and SDK compose into the SEAT system — with the trust and data-flow boundaries.

Composition

Data flows

There are two deliberately separate flows:

FlowPathCarries
Signalleader wallet → chain logs → keeper → risk evaluationInformation about trades
Capitaldepositors → DeskVault → SwapAdapter → DEX → positions → depositorsUSDG and Stock Tokens

The leader never enters the capital path. The keeper touches capital only through the single executeCopy entry point, which is itself gated by the on-chain risk module.

Layers and their trust

LayerComponentsTrust assumption
Funds custodyDeskVaultNon-upgradable contract; owner can pause and configure but cannot withdraw user funds
DecisionRiskModulePure, deterministic, owner-configured
ExecutionSwapAdapter + routerRestricted surface; no arbitrary calldata; reverts without a configured router
ObservationKeeperSingle operator; can only propose copies — the vault re-verifies
PricingChainlinkOracle + Chainlink feedsExternal data dependency with staleness bounds
PresentationApp + SDKRead-mostly; writes go straight to the contracts

Dependency map (code level)

  • DeskVault → IRiskModule, ISwapAdapter, IPriceOracle (NavLib), FeeModule, IStakingPool, OpenZeppelin (Ownable, Pausable, ReentrancyGuard, SafeERC20)
  • DeskFactory → deploys DeskVault; IERC20 for the $SEAT bond
  • SwapAdapter → IExactInputRouter; ExactInputRouter02 → ISwapRouter02 (Uniswap)
  • ChainlinkOracle → AggregatorV3Interface
  • keeper → @seat/sdk (registry, NAV math, chain constants)
  • app → @seat/sdk, wagmi/viem, ABIs extracted from Foundry out/

Failure isolation

  • Keeper down → no new copies; funds unaffected. (details)
  • Oracle stale/missing → valuation reverts; copies rejected; deposits/withdrawals that need pricing revert.
  • Router unset → SwapAdapter.execute reverts; the vault cannot trade at all.
  • Owner key compromise → worst case is pause + misconfiguration, not fund theft (no owner withdrawal path exists). See Security.