Skip to content

Show public yield + pool data on Assets and Earn pages when no wallet is connected #157

@kostovster

Description

@kostovster

Symptom (no wallet connected)

  • Assets page: every non-NLS row shows 0 (or no value) in the Yield column. Only NLS renders a yield (currently 4.01%).
  • Earn page: table renders with header rows but zero data rows ("0 Assets"), even though the data is loaded in memory.

With a wallet connected, both pages render correctly. NLS is the only asset that survives the no-wallet state because it goes through the native-staking branch, not the protocol-gated branch.

Root cause

Both pages drop their rows through the same gate. configStore.getActiveProtocolsForNetwork(configStore.protocolFilter) returns [] when protocolFilter === "", which is the disconnected state. Per-row computeds then drop every protocol-gated row.

  • Earn pagesrc/modules/earn/view.vue:129-135 filters earnStore.pools by activeProtocols.includes(pool.protocol). Empty activeProtocols ⇒ zero rows.
  • Assets page Yield columnsrc/common/composables/useNetworkCurrency.ts:90-95 requires the LPN's protocol to be in networkProtocols. Empty list ⇒ isEarnable: false, apr: 0.

The data itself is public protocol metadata and is already fetched on app boot regardless of wallet (src/common/stores/connection/index.ts:76 calls initializeApp() which loads earnStore.pools and asset metadata). Only the per-row filter is hiding it.

configStore.initialize() at src/common/stores/config/index.ts:770 already falls back to OSMOSIS when protocolFilter === "" for the asset list itself, which is why the Asset rows render at all — but the same fallback is not applied to the Earn pool filter or the Yield-cell resolver.

Options

Option 1 — Default network when no wallet

When no wallet is connected, treat protocolFilter as "OSMOSIS" (or the first entry of WALLET_PRODUCIBLE_NETWORKS). Single touch point in applyWalletProtocolFilter (src/common/utils/walletProtocolFilter.ts) on disconnect.

  • Files touched: 1–2.
  • Complexity: small.
  • Trade-off: partly walks back the wallet-driven-only stance from refactor: drive network filter from connected wallet #151. A future contributor may extend the default to the SOLANA-wallet case where the empty network is intentional ("fail loudly" per CLAUDE.md:257).

Option 2 — Decouple public data from protocolFilter

Treat yield rates and pool composition as public per-protocol metadata, independent of the user's network. User-specific data (supplied balances, positions) stays gated on the wallet as today.

  • Earn view: when protocolFilter === "", render pools across all WALLET_PRODUCIBLE_NETWORKS.

  • useNetworkCurrency.resolveEarn: when protocolFilter === "", fall through to all active protocols when matching the LPN by ticker.

  • Files touched: src/modules/earn/view.vue:126-175, src/common/composables/useNetworkCurrency.ts:83-105. ~40 lines across 2 files.

  • Complexity: medium.

  • Trade-off: getActiveProtocolsForNetwork is consumed in 8+ places (lease forms, swap form, etc.). Each consumer needs a check to confirm the new "show all when no filter" behavior is appropriate at that site — for user-specific computeds it is not.

Option 3 — Empty-state CTA

Replace the broken-looking zero rows with a "Connect a wallet to view yields and pools" message.

  • Files touched: src/modules/earn/view.vue, src/modules/assets/components/AssetsTable.vue.
  • Complexity: small.
  • Trade-off: does not actually fix the visibility request. Useful only as a safety net combined with Option 1 or 2.

Design call to make first

If we go with Option 2, when the same pool exists under multiple protocols and we show "all", do we render one row per protocol (truthful, mirrors the connected case) or pick one canonical row per pool (cleaner, hides the multi-protocol shape)? Recommendation is one row per protocol so the disconnected and connected views are structurally identical.

Files referenced

  • src/modules/assets/components/AssetsTable.vue:64,93,133-140
  • src/common/composables/useNetworkCurrency.ts:83-105
  • src/modules/earn/view.vue:126-175
  • src/common/stores/earn/index.ts:99-111
  • src/common/stores/connection/index.ts:76
  • src/common/stores/config/index.ts:146-148, 770
  • src/common/utils/walletProtocolFilter.ts:37-39
  • src/common/types/index.tsWALLET_PRODUCIBLE_NETWORKS
  • CLAUDE.md:257-258 — wallet-driven protocolFilter architectural note

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions