I've tried Googling this using several phrases and I simply can't find this asked anywhere so I hope this isn't too silly a question.
I'm just dipping my toes into DDD and I have a toy project I'm building around Defi in the crypto space. In short the point of the project is to read a bunch of information from smart contracts and then performs some calculation and analysis to determine degrees of token inflation etc.
I've modelled my domain into entities and Value Objects as described below, but I end up with multiple "orphaned" entities that don't seem to fit into an aggregate.
I've not seen this situation mentioned anywhere so I wonder if a single entity is aggregateless or if it simply becomes the root of an aggregate without sub-entities?
This is how I modelled my domain
- Entity: DeFi Farm (aggregate root) - Represents a DeFi farm containing multiple staking pools. Pools make no sense outside of a farm it
- Entity: DeFI Staking Pool (part of DeFi Farm aggregate root) - Represents a given pool its reward payout rate etc. Doesn't make any sense outside of an exchange so part of that aggregate
- Entity: Stakeable asset - Used in Staking pools. Can exist outside of a staking pool though and is sort of independent of the DeFi farm too (reason being a given stakeable asset could be used in multiple farms)
- Value Object: Token - ERC20 token. Stands on its own. Used by stakeable assets, farms and pools but doesn't need them to exist
- Entity: Smart Contract - Used by all of the above but makes sense outside of them (i.e. there exist things that use smart contracts that are neither of the things I have in my domain so far)
- Entity: Blockchain Network - An exchange lives on a given network, but the network happily exists without any of the other things.
So now I'm in a position where Pool, Token, Staked Asset, Token, Contract and Network have a life of their own. Should these be aggregate-less entities or simply entities in aggregates of size 1?
I'm also a bit unsure on Entity vs Value Object here because in Blockchain everything has a unique ID by design (its contract address).
Thanks in advance.