Whitepaper
SpinPigs: Decentralized Rotating Savings on Polygon
1.Abstract
SpinPigs is a decentralized Rotating Savings and Credit Association (ROSCA) protocol built on the Polygon blockchain. It combines the centuries-old concept of community savings groups with smart contract automation and DeFi yield generation through Aave V3. Members form 5-person groups, contribute weekly in USDT, and receive payouts in a lottery-determined order. Idle funds earn interest automatically, creating a savings mechanism that outperforms traditional interest rates for early-position members.
2.Introduction
Traditional ROSCAs (known as "altın günü" in Turkey, "chit funds" in India, "tandas" in Latin America) have been used for centuries as informal community savings mechanisms. However, they suffer from key problems:
- Trust: Members must trust each other to make payments. Default risk increases for later positions.
- Transparency: No verifiable record of contributions and payouts.
- No Yield: Pooled funds sit idle, earning nothing.
- Geographic Limits: Traditionally limited to local communities.
SpinPigs solves these problems by replacing trust with smart contracts, providing full transparency through blockchain records, generating yield through DeFi integration, and enabling global participation.
3.System Architecture
The protocol consists of three core smart contracts deployed on Polygon:
GroupManager
The main entry point. Manages group creation, member enrollment, payment tracking, lottery execution, and payout distribution. Includes Pausable and rate limiting for safety.
CollateralManager
Handles collateral deposits, position-based refunds, penalty deductions, and yield strategy integration. Manages the flow of funds to and from Aave V3.
AaveV3Strategy
The yield strategy contract that interfaces with Aave V3 Pool on Polygon. Supplies USDT to earn aUSDT, and withdraws when payouts are needed. Owned by CollateralManager for security.
4.Collateral Model
Collateral eliminates the trust problem inherent in traditional ROSCAs:
- Maximum deposit: All members deposit the maximum collateral (3x weekly amount) when joining.
- Position-based refunds: After the lottery, excess collateral is refunded. Position 1-2 get more back; position 5 retains full collateral.
- Auto-deduction: If a member misses a payment, their collateral covers it automatically.
- Penalty system: Persistent non-payment results in collateral forfeiture, redistributed to affected members.
This ensures that every scheduled payout can be fulfilled regardless of individual member behavior.
5.Yield Strategy
Funds that would otherwise sit idle are put to work through Aave V3:
- Supply: Weekly payments and collateral are supplied to Aave V3, earning variable interest as aUSDT.
- Withdraw: When a payout is due, the exact amount is withdrawn from Aave (principal + interest).
- Interest distribution: 80% of yield goes to the group member receiving the payout. 20% is the platform fee.
- Rounding safety: The contract tracks actual USDT balance changes (not intended amounts) to handle Aave V3 rounding.
Earlier positions benefit more because their contributions sit in Aave longer, accumulating more interest before their payout week.
6.Position Lottery
When the 5th member joins a group, the lottery executes automatically:
- Positions 1-4 receive payouts in weeks 1-4 respectively.
- Position 5 does not receive a payout week — their collateral covers their contribution share.
- Randomness is derived from on-chain data (block hash, timestamp, addresses) for fairness.
- All lottery results are recorded on-chain and publicly verifiable.
7.Payment Flow (MINI Pool Example)
| Week | Each Member Pays | Pool Total | Recipient |
|---|---|---|---|
| Week 1 | $5 USDT | $20 USDT + interest | Position 1 |
| Week 2 | $5 USDT | $20 USDT + interest | Position 2 |
| Week 3 | $5 USDT | $20 USDT + interest | Position 3 |
| Week 4 | $5 USDT | $20 USDT + interest | Position 4 |
Position 5 contributes each week but does not receive a payout week. Their total contribution ($20) is covered by their collateral deposit.
8.Smart Contract Security
- OpenZeppelin: Built on audited OpenZeppelin contracts (Ownable, ReentrancyGuard, Pausable).
- Pausable: Owner can pause all user-facing operations in emergencies.
- Rate Limiting: 5-minute cooldown between group joins to prevent spam.
- Emergency Withdraw: Owner can recover all funds in case of critical vulnerability discovery.
- Access Control: AaveV3Strategy is owned by CollateralManager — only the contract system can supply/withdraw funds.
- Verified Source: All contracts are verified and open-source on PolygonScan.
9.Fee Structure
| Fee Type | Amount | Notes |
|---|---|---|
| Deposit Fee | 0% | No fee on principal |
| Payment Fee | 0% | No fee on weekly payments |
| Yield Fee | 20% | On Aave V3 interest only |
| Gas Fees | Variable | Paid in MATIC by each user |
10.Roadmap
Phase 1: Core Protocol
5-member groups, USDT on Polygon, Aave V3 yield, collateral system, on-chain lottery
Phase 2: Safety & Operations
Pausable contracts, rate limiting, force-withdraw, per-pool intervals, monitoring
Phase 3: Expansion
Standard & Premium pools, additional stablecoins, multi-chain deployment, governance token
11.Contract Addresses (Polygon Mainnet)
GroupManager
0xeE17893844a004f85e3EedC95d1F355F7E363ce6
CollateralManager
0x6a4E7d516011840D192dd689F7Efc32E03Cb31Fa
AaveV3Strategy
0xe08F4cF77Fc469E70e7380bd4ae8FC56641Ff331
All contracts are verified and open-source on PolygonScan.