Selecting an Oracle
Test the Oracle
import { PoolOracle } from '@blend-capital/blend-sdk';
// allow logging of bigints and maps
const replacer = (key, value) => {
if (value instanceof Map) {
return {
dataType: "Map",
value: Array.from(value.entries()),
};
} else if (typeof value == "bigint") {
return {
dataType: "BigInt",
value: value.toString(),
};
} else {
return value;
}
};
const network = {
passphrase: 'Public Global Stellar Network ; September 2015',
rpc: 'some-rpc-url'
};
// the contract address of the oracle
const oracle_id = "C...";
// the contract addresses of the assets being included as reserves
const assets = ["C...", "C...", "C..."];
const oracle = await PoolOracle.load(network, oracle_id, assets);
// validate results
console.log(JSON.stringify(oracle, replacer, 2));Oracle Adapters
Types of Price Feeds
Price Feed Aggregation
Well Known Oracles
Last updated
