How to Add a Market as a Solver
Listing a Market
Step 1: Modify the Muon Oracle
async function getNewExchangePrices() {
return withSpan(
getNewExchangePrices.name,
spanTypes.newExchangePriceFetch, // You need to define this span type
async function () {
const newExchangeUrl = priceUrl + "/newExchange";
let data;
try {
const result = await axios.get(newExchangeUrl);
data = result.data;
} catch (e) {
console.log(e);
throw new Error("FAILED_TO_GET_NEW_EXCHANGE_PRICES");
}
const pricesMap = {};
data.forEach((el) => {
try {
pricesMap[el.symbol] = scaleUp(Number(el.price).toFixed(10)).toString();
} catch (e) {}
});
return pricesMap;
},
[]
);
}
const getSorucePrices = {
binance: getBinancePrices,
kucoin: getKucoinPrices,
mexc: getMexcPrices,
newExchange: getNewExchangePrices, // Add the new exchange function here
};sStep 2: Make a Pull Request
Step 3: Add the Symbol to Solver Endpoints
Step 4: Add the Market on the Contracts
De-Listing a Market
Last updated
