Financial services that are not only related to crypto-currencies but rely on blockchain for security and integrity are jointly referred to as Decentralized Fiance (DeFi) and are evolving rapidly. Given their novel applications of DLT and sophistical economical designs, the distinction between DeFi services and understanding the involved risk are often complex. This paper systematically studies the major classes of DeFi protocols, including risk and security. The selection of DeFi categories is based on a quantitative approach, covering over 80% of total value locked (TVL) in DeFi. Further, a structured methodology is provided to differentiate between DeFi protocols based on the algorithmic design and blockchain-network architecture. The findings indicate that every DeFi protocol falls into one of the three classes of DeFi algorithms: liquidity pool, synthetic asset or aggregator protocol. This work concludes with the risk analysis that is derived from the DeFi protocol, underlying tokens and agents. Certain DeFi assets, such as crypto-backed stablecoins, liquid staking tokens, and wrapped tokens of bridges, are synthetic assets, similar to derivatives in traditional finance, and bore similar risk exposure.