transactions working for vault + portfolio#7
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds a new positions tracking and display feature to the frontend, including a dedicated positions page, a React hook for localStorage-persisted position management with yield calculations, and enhanced deposit flow with market expiry awareness. Also updates deployment configuration with actual program IDs and adds a build script for environment setup. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI as MarketCard / DepositModal
participant Hook as usePositions Hook
participant Storage as localStorage
User->>UI: Click "Stake on Yes/No"
UI->>UI: Open DepositModal with marketExpiry
User->>UI: Confirm deposit amount
UI->>Hook: Call addPosition(marketId, marketQuestion,<br/>position, amount, expiryTimestamp)
Hook->>Storage: Persist new UserPosition
Storage-->>Hook: Position saved
Hook-->>UI: Return void
UI->>User: Display "Position Secured!" success
Note over Storage: Position tracked with<br/>timestamp & expiry
par Continuous Tracking
Hook->>Hook: Calculate yield on mount & storage events<br/>using MOCK_APY (0.12) & elapsed time
Hook->>Storage: Load & sync positions from storage
end
User->>User: Navigate to /positions
UI->>Hook: usePositions() → fetch all positions
Hook->>Storage: Read polyield_positions_<publicKey>
Storage-->>Hook: Return positions array
Hook->>Hook: Compute totalYield, totalValue<br/>via APY formula
Hook-->>UI: Return positions, totalYield, totalValue, apy
UI->>User: Render PositionsList with<br/>summary & position details
Estimated code review effort🎯 4 (Complex) | ⏱️ ~70 minutes Poem
✨ Finishing touches
Comment |
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.