Skip to content

Implement Boost allocation flow — contract call, UI controls, and multiplier preview #21

Description

@prodbycorne

Problem

The Boost button on every farm row is permanently disabled with opacity={0.6} and cursor='not-allowed'. No boost allocation flow exists anywhere in the frontend.

The contract exposes a boost mechanism where users can allocate a percentage of their locked position to a boost tier that multiplies credit accrual. None of this is reachable from the UI.

Expected Behaviour

Clicking Boost on a farm row opens a modal that:

  1. Shows the user's current boost allocation percentage and the resulting multiplier
  2. Lets them slide or type a new allocation percentage (0–100 %)
  3. Displays a real-time preview of the new daily credit accrual rate
  4. Requires signing and submitting a configure_boost contract call via Freighter

Acceptance Criteria

  • Boost modal at src/components/BoostModal/BoostModal.tsx with percentage slider (Chakra Slider) and credit-rate preview
  • Credit-rate preview formula: dailyRate × (1 + (boostAllocation / 100) × (multiplier - 1)) where multiplier is fetched from the pool's BoostConfig
  • useBoostConfig(poolId) hook added to useSorobanQuery.ts — calls sorobanService.getBoostConfig(poolId) which is currently a stub returning { multiplier: 2, allocationPercentage: 0, isActive: false }
  • sorobanService.configureBoost(poolId, publicKey, allocationPercentage, walletApi) implemented with proper Soroban transaction building, simulation, signing, and submission
  • The Boost button in EarningRow is enabled only when boostConfig.isActive is true and the user has an active stake; it shows the user's current allocation percentage as a badge
  • On success, userPosition cache is invalidated so the farm row reflects the updated boost allocation immediately

Relevant Files

  • src/app/farm/page.tsxEarningRow Boost button (currently disabled)
  • src/lib/soroban.tsgetBoostConfig, configureBoost (stub methods)
  • src/hooks/useSorobanQuery.tsuseBoostConfig, useConfigureBoost
  • src/types/farm.ts — may need boostAllocation added to FarmPosition

Metadata

Metadata

Assignees

No one assigned

    Labels

    Official CampaignCampaign: Official CampaignfarmFarming/staking flow — deposit, lock, unlock, creditshardRequires deep domain knowledge — Soroban, Stellar SDK, or complex statesorobanSoroban smart-contract integration (XDR, RPC, transaction building)

    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