Description
The AaveAdapter implements the ProtocolAdapter interface, but there is no registry or factory for protocol adapters. Adding a new protocol (Compound, Uniswap, etc.) requires manual wiring with no discovery mechanism. The DeFiModule doesn't register the adapter as a provider, so it can't be injected into services. This blocks all future DeFi protocol integrations.
Direction
- Create
src/defi/protocols/protocol-registry.service.ts following the same registry pattern as StrategyRegistry in core/auth.
- Register
AaveAdapter as a provider in DeFiModule and auto-register it with the registry on module init.
- Define a
ProtocolAdapterMetadata interface so adapters self-describe their supported chains and capabilities.
- Expose a
getAdapter(protocolName: string) method on the registry for runtime protocol selection.
- Add a controller endpoint
GET /api/v1/defi/protocols that lists available protocols.
Definition of Done
- A
ProtocolRegistry service exists and auto-discovers all registered protocol adapters.
- Adding a new protocol requires only: (a) create adapter file, (b) register in module providers.
Acceptance Criteria
Description
The
AaveAdapterimplements theProtocolAdapterinterface, but there is no registry or factory for protocol adapters. Adding a new protocol (Compound, Uniswap, etc.) requires manual wiring with no discovery mechanism. TheDeFiModuledoesn't register the adapter as a provider, so it can't be injected into services. This blocks all future DeFi protocol integrations.Direction
src/defi/protocols/protocol-registry.service.tsfollowing the same registry pattern asStrategyRegistryincore/auth.AaveAdapteras a provider inDeFiModuleand auto-register it with the registry on module init.ProtocolAdapterMetadatainterface so adapters self-describe their supported chains and capabilities.getAdapter(protocolName: string)method on the registry for runtime protocol selection.GET /api/v1/defi/protocolsthat lists available protocols.Definition of Done
ProtocolRegistryservice exists and auto-discovers all registered protocol adapters.Acceptance Criteria
ProtocolRegistryservice is created withregister()andgetAdapter()methodsAaveAdapteris registered as a provider inDeFiModuleDeFiModule.onModuleInit()registers all adapters with the registryGET /api/v1/defi/protocolsreturns the list of available protocolsCompoundAdapter) requires no changes to the registrynpm run buildsucceeds