Flows (Mine, Invest, Claim, Remove)
Mine external entry:
- Resolve audio URL; pin audio and image to R2
- Build metadata JSON; pin to R2 →
metaCid
(entry id) - Compute partition using top APR
- Contract
invest(user, metaCid, escrow_stroops)
- Payment
userPay(ISSUER_ID, pay)
in lumens - Contract
invest(user, metaCid, equity_stroops)
- Index to Algolia; sync shares and tvl/apr/escrow
Invest on existing entry:
- Contract
invest(user, id, amount_stroops)
- Fetch on-chain; update Algolia tvl/apr/escrow; update shares
Claim earnings:
- Preview with read-only query; only invoke contract if
claimable > 0
Remove entry:
- Remove from contract (admin)
- Delete Algolia record
- Delete R2 prefixes for metadata and content hashes (image/audio/video)