How the adapter works
Each adapter instance wraps a single DIA oracle and one asset key (e.g.BTC/USD). When your contract calls latestRoundData(), the adapter reads the latest value from DIA’s oracle via getValue() and maps it onto Chainlink’s round format:
answer: the latest DIA price, returned with 18 decimals by default.updatedAt: the timestamp of DIA’s most recent update.roundId: set to the currentblock.number.
Before and after
In practice, only the feed address changes.Migrate in three steps
1
Get the DIA oracle address and asset key
From your network’s page in the chain-specific guides, copy the DIA oracle contract address and the asset key you need (e.g.
BTC/USD).2
Deploy or obtain the adapter
Deploy
DiaAssetSpecificCallingConvention(diaOracleAddress, description, pairKey). The repo ships a Hardhat deploy script (scripts/deployAdapter.ts). One adapter is deployed per asset.3
Swap the address
Replace the Chainlink feed address in your contract with the adapter address. No other code changes are required.