Description: Create a comprehensive portfolio endpoint (/portfolio/:address) that aggregates a user's total interactions with TradeFlow. The backend must fetch the user's on-chain token balances and active LP positions, calculate their current fiat/USDC value using indexed pool ratios, and return a unified net-worth payload.
Context / Motivation: Users need a single dashboard to view their total value locked, current asset allocation, and overall profitability across the TradeFlow ecosystem.
Acceptance Criteria: - [ ] Utilize the Stellar SDK to fetch all token trustlines and balances for the requested address.
Description: Create a comprehensive portfolio endpoint (
/portfolio/:address) that aggregates a user's total interactions with TradeFlow. The backend must fetch the user's on-chain token balances and active LP positions, calculate their current fiat/USDC value using indexed pool ratios, and return a unified net-worth payload.Context / Motivation: Users need a single dashboard to view their total value locked, current asset allocation, and overall profitability across the TradeFlow ecosystem.
Acceptance Criteria: - [ ] Utilize the Stellar SDK to fetch all token trustlines and balances for the requested address.
Technical Pointers: Use
server.accounts().accountId(...)via the Stellar SDK to fetch raw balances. This endpoint will perform multiple async operations; optimize by usingPromise.all()where dependencies allow.