91 Funds.
91 Funds is private fintech product work combining multi-asset vault contracts, subscription credentials, verified on-chain deposits, scheduled fund accounting, and tightly controlled withdrawal workflows. This case study focuses on the engineering responsibilities and trust boundaries without exposing client-confidential business details.
- Role
- Full-cycle Backend Engineer · Smart Contract Developer
- Domain
- Decentralized asset management · Quantitative finance · DeFi infrastructure
System at a glance
What the system does
Upgradeable multi-asset vaults
High-water-mark settlement
Receipt-level deposit verification
Multi-factor withdrawal controls
Architecture flow
From intent to verified state.
- 01
A NestJS API authenticates investors and operators and coordinates investment workflows.
- 02
MongoDB holds transactional state while Redis supports caching and short-lived operational data.
- 03
The transaction engine independently verifies EVM receipts before crediting internal balances.
- 04
Scheduled workers run portfolio settlement, subscription expiry, and approved withdrawal operations.
- 05
Upgradeable vault and soulbound subscription contracts provide the on-chain custody and entitlement layer.
01 / On-chain custody
Upgradeable vaults with constrained authority
Multi-asset vault
The Solidity vault accepts an explicitly managed set of ERC-20 assets, calculates platform fees at deposit time, transfers treasury fees, and credits the depositor with the net amount.
Upgradeable security primitives
Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable, SafeERC20, and EnumerableSet provide controlled upgrades, guarded external calls, resilient token transfers, and efficient asset whitelisting.
Delegated execution
A restricted approved-or-owner path allows an operational wallet to execute reviewed withdrawals without receiving every privilege held by the contract owner.
02 / Verification
Balances are derived from chain evidence, not browser claims
The backend treats a submitted transaction hash as a reference to verify—not as proof by itself.
Receipt inspection
Ethers.js retrieves the deterministic transaction receipt, checks successful execution, and filters logs for the exact deposit event signature emitted by the expected contract.
Parameter cross-checking
Decoded sender, asset, and BigInt amount values are compared with the authenticated user and current database intent before any internal investment balance is allocated.
Replay resistance
Persisted transaction identity and state checks prevent one confirmed deposit from being submitted repeatedly to manufacture duplicate off-chain credit.
03 / Financial engine
Scheduled accounting around a high-water mark
Performance-fee basis
The settlement model charges performance fees only on net gains above an investor’s previous highest portfolio valuation, preserving the high-water-mark principle across cycles.
Cyclic settlement
Scheduled NestJS workers evaluate returns during defined fund cycles, calculate performance statistics, apply relevant fees or discounts, and credit the resulting net yield.
Hierarchical rewards
Referral and regional-ranking logic aggregates eligible volume through parent relationships and applies tier-specific commissions, overrides, rebates, and vouchers.
04 / Identity & withdrawals
Defense in depth for money leaving the system
Three independent factors
Sensitive withdrawals require a time-based authenticator code, an SMS one-time code, and an email one-time code before they can enter the approval workflow.
Human and worker separation
A validated request first becomes pending. An administrator reviews it before a worker invokes the contract, monitors gas and confirmation state, and synchronizes the final result.
Auditable operations
Winston rotating logs, explicit transaction states, and automated alerts make financial actions and failures inspectable after execution.
05 / Subscription layer
Non-transferable credentials tied to verified access
Soulbound subscription NFT
An ERC-721 token represents a subscription tier and expiry time, while transfer and approval paths are disabled so entitlement cannot be sold or moved to another wallet.
Metadata pipeline
The backend composes subscription artwork with Sharp, publishes the asset and metadata through Pinata to IPFS, and coordinates minting after the surrounding business checks succeed.
Modular backend foundation
NestJS modules, dependency injection, guards, interceptors, validation pipes, Mongoose models, Redis caching, Swagger documentation, and a separate CoinGecko price worker keep responsibilities explicit.