Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    SubscriptionConductor
    PaymentConductor
    Payments Overview
    Public Pools & DAO Jars
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    Peer Games
    News Module
    Member Blogs
    Public Profile Pages
    Ring File Cabinet
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)

    Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    SubscriptionConductor
    PaymentConductor
    Payments Overview
    Public Pools & DAO Jars
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    Peer Games
    News Module
    Member Blogs
    Public Profile Pages
    Ring File Cabinet
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)

    Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    SubscriptionConductor
    PaymentConductor
    Payments Overview
    Public Pools & DAO Jars
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    Peer Games
    News Module
    Member Blogs
    Public Profile Pages
    Ring File Cabinet
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)
    1. Docs
    2. /Features
    3. /Public Pools & DAO Jars

    Updated Jul 22, 20265 min listen

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

    1. Docs
    2. /Features
    3. /Public Pools & DAO Jars

    Updated Jul 22, 20265 min listen

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

    1. Docs
    2. /Features
    3. /Public Pools & DAO Jars

    Updated Jul 22, 20265 min listen

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

    Public Pools & DAO Jars

    Public pools are community funding jars per clone. Members like and chip in toward a native-token goal; docs embed the same jar via <FutureFeatureWidget />. Product routes live under /dao (not /pools). Money SSOT for card/PayPal chip-ins is PaymentConductor purpose public_pool_contribution — not PSP “donation product” APIs.

    Use Founder / Developer tabs in the docs sidebar to filter this page. Sidebar visibility is controlled by lib/docs/audience-curated-docs.ts.

    Not PSP donation jars

    WayForPay hosted Донати, Stripe Checkout submit_type=donate, and PayPal Donate SDK are not the Ring jar SSOT. Ring card/PayPal chip-ins use PaymentConductor.createCheckout({ purpose: 'public_pool_contribution' }) via POST /api/public-pools/[slug]/card-checkout. Native chip-ins use treasury SPL transfer (contributeToPool) — outside Conductor.

    What shipped (2026-07-21)

    TrackStatusTruth
    Tier A interactive chatLivepoll, rsvp, dao_jar, share_card remediated (jar refresh, meetup RSVP, poll closeAt cron, locked votes)
    TD-MONEY-01 Card jarLivePurpose public_pool_contribution; settle bumps pledged_native_token via desk oracle FX
    TD-MONEY-02 Builder payoutLiveOn ≥100% funding: auto-complete + treasury pays net (pledged − role fee) to builder’s primary Solana wallet
    TD-MONEY-03 EscrowPartialAnchor program at solana/programs/public-pool (init/contribute/finalize/refund). Donation path live; on-chain escrow contribute needs deploy + IDL wire
    Dual-currency CTALivePoolContributePanel — fiat for card/PayPal; native symbol for chip-in; shows credit + native balances
    Do not claim

    Card jar is not 1:1 fiat↔RING. PublicPool escrow is not production-live. Builder payout is not always full pledged (fee 0 only for admin/superadmin roles by default).

    Money paths (shared)

    Public pool money paths

    FX SSOT (same as Token Desk): nativeUi = fiatMajor / ringPerUsd via getRingPerUsdRate / features/public-pools/lib/public-pool-desk-fx.ts.

    Platform fee SSOT: ring-config.json → publicPools.platformFeePercentByRole (defaults: admin/superadmin 0%, confidential 6%, member 7%).

    Why jars matter for your clone

    Members fund features and collective goals in your native token (and card fiat converted at the live desk rate). When a jar fills, the opportunity owner receives net native token to their primary custodial Solana wallet — minus your configured role fee. Collective-order forms show this clearly (collectiveJarPayoutNote in opportunities locales).

    PaymentConductor

    Card/PayPal purpose public_pool_contribution shares the same ledger and webhooks as store and wallet.

    Wallet & Token Desk

    Desk oracle rate is the same FX used when card chip-ins become pledged native units.

    Messaging

    dao_jar chat widgets refresh after contribute; post jars from docs or .

    Implementation

    Surfaces

    SurfacePath
    Public list / detail/[locale]/dao, /[locale]/dao/[slug]
    Admin/[locale]/admin/dao
    Docs widgetcomponents/docs/future-feature-widget.tsx → PoolContributePanel
    Chat jarfeatures/public-pools/components/dao-jar-message-widget.tsx
    Dual CTAfeatures/public-pools/components/pool-contribute-panel.tsx

    Verified HTTP / settle

    MethodPathRole

    Related documentation

    Related documentation

    PaymentConductor

    Depends-on: card/PayPal jar settle uses PaymentPurpose public_pool_contribution and shared webhooks.

    Wallet & Credit System

    Depends-on: desk oracle ringPerUsd is the FX SSOT for fiat→pledged native.

    Real-Time Messaging

    Same-workflow: dao_jar widgets and PostDaoJarToChatButton after contribute refresh.

    Opportunities

    Next-step: collective jars pay the opportunity builder wallet when funding hits 100%.

    Public Pools & DAO Jars

    Public pools are community funding jars per clone. Members like and chip in toward a native-token goal; docs embed the same jar via <FutureFeatureWidget />. Product routes live under /dao (not /pools). Money SSOT for card/PayPal chip-ins is PaymentConductor purpose public_pool_contribution — not PSP “donation product” APIs.

    Use Founder / Developer tabs in the docs sidebar to filter this page. Sidebar visibility is controlled by lib/docs/audience-curated-docs.ts.

    Not PSP donation jars

    WayForPay hosted Донати, Stripe Checkout submit_type=donate, and PayPal Donate SDK are not the Ring jar SSOT. Ring card/PayPal chip-ins use PaymentConductor.createCheckout({ purpose: 'public_pool_contribution' }) via POST /api/public-pools/[slug]/card-checkout. Native chip-ins use treasury SPL transfer (contributeToPool) — outside Conductor.

    What shipped (2026-07-21)

    TrackStatusTruth
    Tier A interactive chatLivepoll, rsvp, dao_jar, share_card remediated (jar refresh, meetup RSVP, poll closeAt cron, locked votes)
    TD-MONEY-01 Card jarLivePurpose public_pool_contribution; settle bumps pledged_native_token via desk oracle FX
    TD-MONEY-02 Builder payoutLiveOn ≥100% funding: auto-complete + treasury pays net (pledged − role fee) to builder’s primary Solana wallet
    TD-MONEY-03 EscrowPartialAnchor program at solana/programs/public-pool (init/contribute/finalize/refund). Donation path live; on-chain escrow contribute needs deploy + IDL wire
    Dual-currency CTALivePoolContributePanel — fiat for card/PayPal; native symbol for chip-in; shows credit + native balances
    Do not claim

    Card jar is not 1:1 fiat↔RING. PublicPool escrow is not production-live. Builder payout is not always full pledged (fee 0 only for admin/superadmin roles by default).

    Money paths (shared)

    Public pool money paths

    FX SSOT (same as Token Desk): nativeUi = fiatMajor / ringPerUsd via getRingPerUsdRate / features/public-pools/lib/public-pool-desk-fx.ts.

    Platform fee SSOT: ring-config.json → publicPools.platformFeePercentByRole (defaults: admin/superadmin 0%, confidential 6%, member 7%).

    Why jars matter for your clone

    Members fund features and collective goals in your native token (and card fiat converted at the live desk rate). When a jar fills, the opportunity owner receives net native token to their primary custodial Solana wallet — minus your configured role fee. Collective-order forms show this clearly (collectiveJarPayoutNote in opportunities locales).

    PaymentConductor

    Card/PayPal purpose public_pool_contribution shares the same ledger and webhooks as store and wallet.

    Wallet & Token Desk

    Desk oracle rate is the same FX used when card chip-ins become pledged native units.

    Messaging

    dao_jar chat widgets refresh after contribute; post jars from docs or .

    Implementation

    Surfaces

    SurfacePath
    Public list / detail/[locale]/dao, /[locale]/dao/[slug]
    Admin/[locale]/admin/dao
    Docs widgetcomponents/docs/future-feature-widget.tsx → PoolContributePanel
    Chat jarfeatures/public-pools/components/dao-jar-message-widget.tsx
    Dual CTAfeatures/public-pools/components/pool-contribute-panel.tsx

    Verified HTTP / settle

    MethodPathRole

    Related documentation

    Related documentation

    PaymentConductor

    Depends-on: card/PayPal jar settle uses PaymentPurpose public_pool_contribution and shared webhooks.

    Wallet & Credit System

    Depends-on: desk oracle ringPerUsd is the FX SSOT for fiat→pledged native.

    Real-Time Messaging

    Same-workflow: dao_jar widgets and PostDaoJarToChatButton after contribute refresh.

    Opportunities

    Next-step: collective jars pay the opportunity builder wallet when funding hits 100%.

    Public Pools & DAO Jars

    Public pools are community funding jars per clone. Members like and chip in toward a native-token goal; docs embed the same jar via <FutureFeatureWidget />. Product routes live under /dao (not /pools). Money SSOT for card/PayPal chip-ins is PaymentConductor purpose public_pool_contribution — not PSP “donation product” APIs.

    Use Founder / Developer tabs in the docs sidebar to filter this page. Sidebar visibility is controlled by lib/docs/audience-curated-docs.ts.

    Not PSP donation jars

    WayForPay hosted Донати, Stripe Checkout submit_type=donate, and PayPal Donate SDK are not the Ring jar SSOT. Ring card/PayPal chip-ins use PaymentConductor.createCheckout({ purpose: 'public_pool_contribution' }) via POST /api/public-pools/[slug]/card-checkout. Native chip-ins use treasury SPL transfer (contributeToPool) — outside Conductor.

    What shipped (2026-07-21)

    TrackStatusTruth
    Tier A interactive chatLivepoll, rsvp, dao_jar, share_card remediated (jar refresh, meetup RSVP, poll closeAt cron, locked votes)
    TD-MONEY-01 Card jarLivePurpose public_pool_contribution; settle bumps pledged_native_token via desk oracle FX
    TD-MONEY-02 Builder payoutLiveOn ≥100% funding: auto-complete + treasury pays net (pledged − role fee) to builder’s primary Solana wallet
    TD-MONEY-03 EscrowPartialAnchor program at solana/programs/public-pool (init/contribute/finalize/refund). Donation path live; on-chain escrow contribute needs deploy + IDL wire
    Dual-currency CTALivePoolContributePanel — fiat for card/PayPal; native symbol for chip-in; shows credit + native balances
    Do not claim

    Card jar is not 1:1 fiat↔RING. PublicPool escrow is not production-live. Builder payout is not always full pledged (fee 0 only for admin/superadmin roles by default).

    Money paths (shared)

    Public pool money paths

    FX SSOT (same as Token Desk): nativeUi = fiatMajor / ringPerUsd via getRingPerUsdRate / features/public-pools/lib/public-pool-desk-fx.ts.

    Platform fee SSOT: ring-config.json → publicPools.platformFeePercentByRole (defaults: admin/superadmin 0%, confidential 6%, member 7%).

    Why jars matter for your clone

    Members fund features and collective goals in your native token (and card fiat converted at the live desk rate). When a jar fills, the opportunity owner receives net native token to their primary custodial Solana wallet — minus your configured role fee. Collective-order forms show this clearly (collectiveJarPayoutNote in opportunities locales).

    PaymentConductor

    Card/PayPal purpose public_pool_contribution shares the same ledger and webhooks as store and wallet.

    Wallet & Token Desk

    Desk oracle rate is the same FX used when card chip-ins become pledged native units.

    Messaging

    dao_jar chat widgets refresh after contribute; post jars from docs or .

    Implementation

    Surfaces

    SurfacePath
    Public list / detail/[locale]/dao, /[locale]/dao/[slug]
    Admin/[locale]/admin/dao
    Docs widgetcomponents/docs/future-feature-widget.tsx → PoolContributePanel
    Chat jarfeatures/public-pools/components/dao-jar-message-widget.tsx
    Dual CTAfeatures/public-pools/components/pool-contribute-panel.tsx

    Verified HTTP / settle

    MethodPathRole

    Related documentation

    Related documentation

    PaymentConductor

    Depends-on: card/PayPal jar settle uses PaymentPurpose public_pool_contribution and shared webhooks.

    Wallet & Credit System

    Depends-on: desk oracle ringPerUsd is the FX SSOT for fiat→pledged native.

    Real-Time Messaging

    Same-workflow: dao_jar widgets and PostDaoJarToChatButton after contribute refresh.

    Opportunities

    Next-step: collective jars pay the opportunity builder wallet when funding hits 100%.

    /dao

    Opportunities

    Collective / builder jars pay the opportunity owner’s primary native wallet when full.

    Operator checklist

    1. Enable public pools in clone config (publicPools in ring-config.json) — fee map + autoPayoutOnGoalMet.
    2. Configure Solana treasury (SOLANA_RPC_URL, SOLANA_TREASURY_PRIVATE_KEY) so native chip-ins and builder payouts can move SPL.
    3. Keep Token Desk / web3 oracle healthy — card settle needs getRingPerUsdRate.
    4. Do not turn on escrow UX until you deploy solana/programs/public-pool and set NEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID.
    5. Test a small card chip-in on /dao/[slug] and confirm pledged native rises by desk-converted units, not 1:1 fiat.

    Typical scenarios

    • Docs backlog item with <FutureFeatureWidget poolSlug="…" /> — members like + chip in from the page.
    • Chat dao_jar — same panel; totals refresh via refreshOpenDaoJarMessages.
    • Collective opportunity jar fills → status completed → treasury pays net RING to builder wallet.
    GET/POST/api/public-poolsList / upsert future_feature stats
    POST/api/public-pools/signalLike toggle
    POST/api/public-pools/contributeNative initiate
    POST/api/public-pools/contribute/confirmNative confirm + jar refresh
    POST/api/public-pools/[slug]/card-checkoutConductor card/PayPal checkout
    */api/admin/public-pools…Admin CRUD + status

    Settle: lib/payments/conductor/handlers/public-pool-contribution.ts → settlePublicPoolCardContribution (idempotent on orderReference). Webhooks: WayForPay / Stripe / PayPal dispatcher branches on purpose === 'public_pool_contribution'.

    Optional processor override: PAYMENT_PUBLIC_POOL_CONTRIBUTION_PROCESSOR (lib/payments/payment.config.ts).

    Modules

    ModuleResponsibility
    features/public-pools/services/public-pool-service.tsTotals, queue gate, auto-complete, builder payout
    features/public-pools/services/public-pool-contribute.tsNative treasury chip-in
    features/public-pools/lib/public-pool-desk-fx.tsDesk-oracle FX
    features/public-pools/lib/public-pool-platform-fee.tsRole fee map
    features/public-pools/lib/public-pool-escrow-gate.tsNEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID / PUBLIC_POOL_PROGRAM_ID
    lib/payments/conductor/settle-public-pool-contribution.tsCard settle → pledged_native_token
    features/chat/lib/refresh-open-dao-jar-messages.tsChat snapshot sync
    solana/programs/public-poolAnchor: init_pool / contribute / finalize_success / refund_contributor

    Desk FX (verified)

    Card checkout accepts amount_fiat or amount_ring and always stores both + ringPerUsd on payment metadata before redirect.

    Builder payout (verified)

    When autoPayoutOnGoalMet and funding ≥ 100%:

    1. Pool → completed
    2. Resolve payout_wallet_address or builder’s primary native wallet
    3. feePercent = resolveBuilderPlatformFeePercent(builderRole)
    4. net = pledged − fee; transferTokenFromTreasury(wallet, net)
    5. Ledger note public_pool_payout with gross/fee/feePct

    Collective-order copy: locales/*/modules/opportunities.json → collectiveJarPayoutNote.

    Escrow gate (not production-live)

    Donation mode (treasury SPL) is the live path. Escrow contribute requires: deploy program → set NEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID → IDL client wire → store on_chain { pool_pda, vault_ata } per jar. Do not document escrow as live in production.

    Env (traced)

    VarUse
    SOLANA_RPC_URLChain RPC
    SOLANA_TREASURY_PRIVATE_KEYNative chip-in + builder payout
    NEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID / PUBLIC_POOL_PROGRAM_IDEscrow gate (optional; not yet in env.local.template)
    PAYMENT_PUBLIC_POOL_CONTRIBUTION_PROCESSOROptional per-purpose PSP override
    Standard WFP / Stripe / PayPal secretsSame Conductor webhooks as other purposes

    Collections

    public_pools, public_pool_signals, public_pool_contributions (clone-scoped via getPublicPoolConfig().cloneId).

    Interactive chat (Tier A)

    Domain owns money; chat owns dao_jar snapshot. After totals change, always refreshOpenDaoJarMessages. Scorecard: AI-CONTEXT concepts/chat-interactive-type-debt.json — Tier A CLOSED; TD-MONEY-01/02 CLOSED; TD-MONEY-03 PARTIAL.

    PaymentConductor architecture

    Deep-dive: conductor types, ledger, and webhook dispatcher.

    ts
    
    // features/public-pools/lib/public-pool-desk-fx.ts
    // nativeUi = fiatMajor / ringPerUsd
    // ringPerUsd from getRingPerUsdRate() — same SSOT as Token Desk
    ts
    
    // features/public-pools/lib/public-pool-escrow-gate.ts
    isPublicPoolEscrowDeployed() // true only when PROGRAM_ID env is set
    /dao

    Opportunities

    Collective / builder jars pay the opportunity owner’s primary native wallet when full.

    Operator checklist

    1. Enable public pools in clone config (publicPools in ring-config.json) — fee map + autoPayoutOnGoalMet.
    2. Configure Solana treasury (SOLANA_RPC_URL, SOLANA_TREASURY_PRIVATE_KEY) so native chip-ins and builder payouts can move SPL.
    3. Keep Token Desk / web3 oracle healthy — card settle needs getRingPerUsdRate.
    4. Do not turn on escrow UX until you deploy solana/programs/public-pool and set NEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID.
    5. Test a small card chip-in on /dao/[slug] and confirm pledged native rises by desk-converted units, not 1:1 fiat.

    Typical scenarios

    • Docs backlog item with <FutureFeatureWidget poolSlug="…" /> — members like + chip in from the page.
    • Chat dao_jar — same panel; totals refresh via refreshOpenDaoJarMessages.
    • Collective opportunity jar fills → status completed → treasury pays net RING to builder wallet.
    GET/POST/api/public-poolsList / upsert future_feature stats
    POST/api/public-pools/signalLike toggle
    POST/api/public-pools/contributeNative initiate
    POST/api/public-pools/contribute/confirmNative confirm + jar refresh
    POST/api/public-pools/[slug]/card-checkoutConductor card/PayPal checkout
    */api/admin/public-pools…Admin CRUD + status

    Settle: lib/payments/conductor/handlers/public-pool-contribution.ts → settlePublicPoolCardContribution (idempotent on orderReference). Webhooks: WayForPay / Stripe / PayPal dispatcher branches on purpose === 'public_pool_contribution'.

    Optional processor override: PAYMENT_PUBLIC_POOL_CONTRIBUTION_PROCESSOR (lib/payments/payment.config.ts).

    Modules

    ModuleResponsibility
    features/public-pools/services/public-pool-service.tsTotals, queue gate, auto-complete, builder payout
    features/public-pools/services/public-pool-contribute.tsNative treasury chip-in
    features/public-pools/lib/public-pool-desk-fx.tsDesk-oracle FX
    features/public-pools/lib/public-pool-platform-fee.tsRole fee map
    features/public-pools/lib/public-pool-escrow-gate.tsNEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID / PUBLIC_POOL_PROGRAM_ID
    lib/payments/conductor/settle-public-pool-contribution.tsCard settle → pledged_native_token
    features/chat/lib/refresh-open-dao-jar-messages.tsChat snapshot sync
    solana/programs/public-poolAnchor: init_pool / contribute / finalize_success / refund_contributor

    Desk FX (verified)

    Card checkout accepts amount_fiat or amount_ring and always stores both + ringPerUsd on payment metadata before redirect.

    Builder payout (verified)

    When autoPayoutOnGoalMet and funding ≥ 100%:

    1. Pool → completed
    2. Resolve payout_wallet_address or builder’s primary native wallet
    3. feePercent = resolveBuilderPlatformFeePercent(builderRole)
    4. net = pledged − fee; transferTokenFromTreasury(wallet, net)
    5. Ledger note public_pool_payout with gross/fee/feePct

    Collective-order copy: locales/*/modules/opportunities.json → collectiveJarPayoutNote.

    Escrow gate (not production-live)

    Donation mode (treasury SPL) is the live path. Escrow contribute requires: deploy program → set NEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID → IDL client wire → store on_chain { pool_pda, vault_ata } per jar. Do not document escrow as live in production.

    Env (traced)

    VarUse
    SOLANA_RPC_URLChain RPC
    SOLANA_TREASURY_PRIVATE_KEYNative chip-in + builder payout
    NEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID / PUBLIC_POOL_PROGRAM_IDEscrow gate (optional; not yet in env.local.template)
    PAYMENT_PUBLIC_POOL_CONTRIBUTION_PROCESSOROptional per-purpose PSP override
    Standard WFP / Stripe / PayPal secretsSame Conductor webhooks as other purposes

    Collections

    public_pools, public_pool_signals, public_pool_contributions (clone-scoped via getPublicPoolConfig().cloneId).

    Interactive chat (Tier A)

    Domain owns money; chat owns dao_jar snapshot. After totals change, always refreshOpenDaoJarMessages. Scorecard: AI-CONTEXT concepts/chat-interactive-type-debt.json — Tier A CLOSED; TD-MONEY-01/02 CLOSED; TD-MONEY-03 PARTIAL.

    PaymentConductor architecture

    Deep-dive: conductor types, ledger, and webhook dispatcher.

    ts
    
    // features/public-pools/lib/public-pool-desk-fx.ts
    // nativeUi = fiatMajor / ringPerUsd
    // ringPerUsd from getRingPerUsdRate() — same SSOT as Token Desk
    ts
    
    // features/public-pools/lib/public-pool-escrow-gate.ts
    isPublicPoolEscrowDeployed() // true only when PROGRAM_ID env is set
    /dao

    Opportunities

    Collective / builder jars pay the opportunity owner’s primary native wallet when full.

    Operator checklist

    1. Enable public pools in clone config (publicPools in ring-config.json) — fee map + autoPayoutOnGoalMet.
    2. Configure Solana treasury (SOLANA_RPC_URL, SOLANA_TREASURY_PRIVATE_KEY) so native chip-ins and builder payouts can move SPL.
    3. Keep Token Desk / web3 oracle healthy — card settle needs getRingPerUsdRate.
    4. Do not turn on escrow UX until you deploy solana/programs/public-pool and set NEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID.
    5. Test a small card chip-in on /dao/[slug] and confirm pledged native rises by desk-converted units, not 1:1 fiat.

    Typical scenarios

    • Docs backlog item with <FutureFeatureWidget poolSlug="…" /> — members like + chip in from the page.
    • Chat dao_jar — same panel; totals refresh via refreshOpenDaoJarMessages.
    • Collective opportunity jar fills → status completed → treasury pays net RING to builder wallet.
    GET/POST/api/public-poolsList / upsert future_feature stats
    POST/api/public-pools/signalLike toggle
    POST/api/public-pools/contributeNative initiate
    POST/api/public-pools/contribute/confirmNative confirm + jar refresh
    POST/api/public-pools/[slug]/card-checkoutConductor card/PayPal checkout
    */api/admin/public-pools…Admin CRUD + status

    Settle: lib/payments/conductor/handlers/public-pool-contribution.ts → settlePublicPoolCardContribution (idempotent on orderReference). Webhooks: WayForPay / Stripe / PayPal dispatcher branches on purpose === 'public_pool_contribution'.

    Optional processor override: PAYMENT_PUBLIC_POOL_CONTRIBUTION_PROCESSOR (lib/payments/payment.config.ts).

    Modules

    ModuleResponsibility
    features/public-pools/services/public-pool-service.tsTotals, queue gate, auto-complete, builder payout
    features/public-pools/services/public-pool-contribute.tsNative treasury chip-in
    features/public-pools/lib/public-pool-desk-fx.tsDesk-oracle FX
    features/public-pools/lib/public-pool-platform-fee.tsRole fee map
    features/public-pools/lib/public-pool-escrow-gate.tsNEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID / PUBLIC_POOL_PROGRAM_ID
    lib/payments/conductor/settle-public-pool-contribution.tsCard settle → pledged_native_token
    features/chat/lib/refresh-open-dao-jar-messages.tsChat snapshot sync
    solana/programs/public-poolAnchor: init_pool / contribute / finalize_success / refund_contributor

    Desk FX (verified)

    Card checkout accepts amount_fiat or amount_ring and always stores both + ringPerUsd on payment metadata before redirect.

    Builder payout (verified)

    When autoPayoutOnGoalMet and funding ≥ 100%:

    1. Pool → completed
    2. Resolve payout_wallet_address or builder’s primary native wallet
    3. feePercent = resolveBuilderPlatformFeePercent(builderRole)
    4. net = pledged − fee; transferTokenFromTreasury(wallet, net)
    5. Ledger note public_pool_payout with gross/fee/feePct

    Collective-order copy: locales/*/modules/opportunities.json → collectiveJarPayoutNote.

    Escrow gate (not production-live)

    Donation mode (treasury SPL) is the live path. Escrow contribute requires: deploy program → set NEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID → IDL client wire → store on_chain { pool_pda, vault_ata } per jar. Do not document escrow as live in production.

    Env (traced)

    VarUse
    SOLANA_RPC_URLChain RPC
    SOLANA_TREASURY_PRIVATE_KEYNative chip-in + builder payout
    NEXT_PUBLIC_PUBLIC_POOL_PROGRAM_ID / PUBLIC_POOL_PROGRAM_IDEscrow gate (optional; not yet in env.local.template)
    PAYMENT_PUBLIC_POOL_CONTRIBUTION_PROCESSOROptional per-purpose PSP override
    Standard WFP / Stripe / PayPal secretsSame Conductor webhooks as other purposes

    Collections

    public_pools, public_pool_signals, public_pool_contributions (clone-scoped via getPublicPoolConfig().cloneId).

    Interactive chat (Tier A)

    Domain owns money; chat owns dao_jar snapshot. After totals change, always refreshOpenDaoJarMessages. Scorecard: AI-CONTEXT concepts/chat-interactive-type-debt.json — Tier A CLOSED; TD-MONEY-01/02 CLOSED; TD-MONEY-03 PARTIAL.

    PaymentConductor architecture

    Deep-dive: conductor types, ledger, and webhook dispatcher.

    ts
    
    // features/public-pools/lib/public-pool-desk-fx.ts
    // nativeUi = fiatMajor / ringPerUsd
    // ringPerUsd from getRingPerUsdRate() — same SSOT as Token Desk
    ts
    
    // features/public-pools/lib/public-pool-escrow-gate.ts
    isPublicPoolEscrowDeployed() // true only when PROGRAM_ID env is set