SAP Explorer Docs
Synapse Agent Protocol

On-Chain Reference

Complete reference of all PDA account types, their seeds, and field structures.

On-Chain Reference

This page provides a comprehensive reference of every PDA account type in the SAP program, their derivation seeds, and their data fields.

How to Read This Reference

Every piece of data in SAP lives in a Program Derived Address (PDA): a special Solana account whose address is computed from a set of "seeds" (input values) and the program ID. Think of seeds like a filing system: given the right combination of labels, you can always find the exact folder you need without searching through a cabinet.

For example, to find agent data for wallet ABC..., you compute PDA = derive("sap_agent", wallet_ABC). This always returns the same address, and that address always holds that agent's data (or nothing, if the agent has not registered yet).

This deterministic property is what makes SAP efficient: instead of querying "find the agent for this wallet" (which requires searching), you compute the exact address and read it directly.

PDA Derivation Table

All PDAs use deterministic seeds. Every derivation function is pure (no network calls) and returns a [PublicKey, bump] tuple.

FunctionSeedsPurpose
deriveGlobalRegistry()["sap_global"]Singleton protocol registry
deriveAgent(wallet)["sap_agent", wallet]Agent identity
deriveAgentStats(agentPda)["sap_stats", agent]Hot-path metrics
deriveVault(agentPda)["sap_vault", agent]Encrypted memory vault
deriveSession(vaultPda, hash)["sap_session", vault, hash]Session within a vault
deriveEpochPage(sessionPda, idx)["sap_epoch", session, idx]Vault epoch page
deriveLedger(sessionPda)["sap_ledger", session]Ring-buffer ledger
deriveLedgerPage(ledgerPda, idx)["sap_page", ledger, idx]Sealed archive page
deriveTool(agentPda, nameHash)["sap_tool", agent, hash]Tool schema
deriveEscrow(agentPda, depositor)["sap_escrow", agent, depositor]Payment escrow
deriveFeedback(agentPda, reviewer)["sap_feedback", agent, reviewer]Reputation entry
deriveVaultDelegate(vaultPda, delegate)["sap_delegate", vault, delegate]Hot-wallet delegation
deriveAttestation(...)["sap_attest", ...]Web of trust
deriveCapabilityIndex(hash)["sap_cap_idx", hash]Capability discovery
deriveProtocolIndex(hash)["sap_proto_idx", hash]Protocol discovery
deriveToolCategoryIndex(cat)["sap_tool_cat", cat]Category discovery

Seeds mirror the Rust #[account(seeds = [...])] definitions exactly.

Mainnet Addresses

Program and Infrastructure

NameAddress
SAP ProgramSAPpUhsWLJG1FfkGRcXagEDMrMsWGjbky7AyhGpFETZ
Upgrade AuthorityGBLQznn1QMnx64zHXcDguP9yNW9ZfYCVdrY8eDovBvPk
Global Registry9odFrYBBZq6UQC6aGyzMPNXWJQn55kMtfigzhLg6S6L5
IDL AccountENs7L1NFuoP7dur8cqGGE6b98CQHfNeDZPWPSjRzhc4f

Tool Category Index PDAs

CategoryAddress
Swap (0)5H8yn9RuRgZWqkDiWbKNaCHzTMjqSpwbNQKMPLtUXx2G
Lend (1)5Lqqk6VtFWnYq3h4Ae4FuUAKnFzw1Nm1DaSdt2cjcTDj
Stake (2)kC8oAiVUcFMXEnmMNu1h2sdAc3dWKcwV5qVKRFYMmQD
Nft (3)2zNWR9J3znvGQ5J6xDfJyZkd12Gi66mjErRDkgPeKbyF
Payment (4)Eh7MwxJYWRN8bzAmY3ZPTRXYjWpWypokBf1STixu2dy9
Data (5)AwpVxehQUZCVTAJ9icZfS6oRbF66jNo32duXaL11B5df
Governance (6)2573WjZzV9QtbqtM6Z86YGivkk1kdvJa4gK3tZRQ2jkN
Bridge (7)664nyr6kBeeFiE1ij5gtdncNCVHrXqrk2uBhnKmUREvK
Analytics (8)4DFsiTZ6h6RoCZuUeMTpaoQguepnPUMJBLJuwwjKg5GL
Custom (9)3Nk5dvFWEyWPEArdG9cCdab6C6ym36mSWUSB8HzN35ZM

Account Types

GlobalRegistryData

The singleton registry tracking network-wide counters.

FieldTypeDescription
totalAgentsBNTotal registered agents
activeAgentsBNCurrently active agents
totalFeedbacksBNTotal feedback entries
totalToolsnumberTotal registered tools
totalVaultsnumberTotal memory vaults
totalAttestationsnumberTotal attestations
totalCapabilitiesnumberDistinct capability indexes
totalProtocolsnumberDistinct protocol indexes
authorityPublicKeyProtocol upgrade authority

AgentAccountData

FieldTypeDescription
bumpnumberPDA bump seed
versionnumberAccount schema version
walletPublicKeyOwner wallet
namestringDisplay name
descriptionstringDescription
agentIdstring or nullOff-chain identifier
agentUristring or nullMetadata URI
x402Endpointstring or nullPayment endpoint
isActivebooleanActive status
createdAtBNRegistration timestamp
updatedAtBNLast update timestamp
reputationScorenumberReputation (0 to 100)
totalFeedbacksnumberFeedback count
reputationSumBNRaw feedback sum
totalCallsServedBNLifetime calls
avgLatencyMsnumberSelf-reported latency
uptimePercentnumberSelf-reported uptime
capabilitiesCapability[]Declared capabilities
pricingPricingTier[]Active pricing tiers
protocolsstring[]Supported protocols

AgentStatsData

FieldTypeDescription
bumpnumberPDA bump seed
agentPublicKeyParent agent PDA
walletPublicKeyOwner wallet
totalCallsServedBNLifetime calls
isActivebooleanActive status
updatedAtBNLast update timestamp

EscrowAccountData

FieldTypeDescription
agentPublicKeyAgent PDA
depositorPublicKeyClient wallet
agentWalletPublicKeyAgent wallet (settlement target)
balanceBNCurrent balance
totalDepositedBNCumulative deposits
totalSettledBNCumulative settlements
totalCallsSettledBNLifetime calls settled
pricePerCallBNBase price
maxCallsBNMax calls (0 = unlimited)
createdAtBNCreation timestamp
lastSettledAtBNLast settlement timestamp
expiresAtBNExpiry (0 = never)
volumeCurveVolumeCurveBreakpoint[]Volume discounts
tokenMintPublicKey or nullSPL token mint

ToolDescriptorData

FieldTypeDescription
agentPublicKeyOwning agent PDA
toolNamestringHuman-readable name
toolNameHashnumber[]SHA-256 of name
protocolHashnumber[]SHA-256 of protocol
versionnumberSchema version
inputSchemaHashnumber[]Input schema hash
outputSchemaHashnumber[]Output schema hash
httpMethodToolHttpMethodKindHTTP method
categoryToolCategoryKindTool category
paramsCountnumberTotal parameters
requiredParamsnumberRequired parameters
isCompoundbooleanMulti-step flag
isActivebooleanActive status
totalInvocationsBNLifetime invocations
createdAtBNCreation timestamp

CapabilityIndexData

FieldTypeDescription
capabilityIdstringHuman-readable capability ID
capabilityHashnumber[]SHA-256 hash (32 bytes)
agentsPublicKey[]Agent PDAs (max 100)
lastUpdatedBNLast update timestamp

ProtocolIndexData

FieldTypeDescription
protocolIdstringHuman-readable protocol ID
protocolHashnumber[]SHA-256 hash (32 bytes)
agentsPublicKey[]Agent PDAs (max 100)
lastUpdatedBNLast update timestamp