PortfolioOracle
ThePortfolioOracle stores politician portfolio allocations on-chain. It serves as the weight source for PoliticianVault instances.
How It Works
- The backend oracle service monitors STOCK Act filings
- Filings are parsed into portfolio weights (token addresses + basis points)
- An authorized reporter calls
updatePortfolio(politicianId, tokens, weights) - The update is stored on-chain with a timestamp
PoliticianVaultcontracts read weights viagetPortfolio(politicianId)
Data Flow
Authorization
Only authorized reporter addresses can update portfolio data. The reporter wallet is managed by the backend service and secured off-chain.Freshness
Each portfolio update includes a timestamp. Consuming contracts can check freshness to avoid acting on stale data.ChainlinkAdapter
TheChainlinkAdapter bridges Chainlink Functions (off-chain API calls) and Chainlink Automation (periodic triggers) to the PortfolioOracle. It handles:
- Constructing off-chain API requests for filing data
- Processing responses into portfolio weight arrays
- Error recovery and retry logic
- Periodic trigger scheduling