Complexity: High
Problem: DAOs and investors need a shared pool to collectively fund invoices and earn proportional yield.
Scope: Build the LendingPool contract that accepts USDC deposits, tracks shares per depositor, allocates funds to escrows, and distributes yield on repayment.
Key methods: deposit(investor, amount), withdraw(investor, amount), allocate(escrow_id, amount), distribute_yield(escrow_id, yield_amount), get_share(investor)
Acceptance criteria: Depositors receive shares proportional to their deposit. Yield is distributed pro-rata. Withdrawal respects available (undeployed) liquidity.
Files to create:
contracts/lending-pool/src/lib.rs
contracts/lending-pool/src/types.rs
contracts/lending-pool/src/storage.rs
contracts/lending-pool/src/math.rs
contracts/lending-pool/src/errors.rs
contracts/lending-pool/Cargo.toml
Complexity: High
Problem: DAOs and investors need a shared pool to collectively fund invoices and earn proportional yield.
Scope: Build the LendingPool contract that accepts USDC deposits, tracks shares per depositor, allocates funds to escrows, and distributes yield on repayment.
Key methods: deposit(investor, amount), withdraw(investor, amount), allocate(escrow_id, amount), distribute_yield(escrow_id, yield_amount), get_share(investor)
Acceptance criteria: Depositors receive shares proportional to their deposit. Yield is distributed pro-rata. Withdrawal respects available (undeployed) liquidity.
Files to create:
contracts/lending-pool/src/lib.rs
contracts/lending-pool/src/types.rs
contracts/lending-pool/src/storage.rs
contracts/lending-pool/src/math.rs
contracts/lending-pool/src/errors.rs
contracts/lending-pool/Cargo.toml