How to Add a Market as a Solver

Listing a Market

Step 1: Modify the Muon Oracle

To add a new market as a solver, first add the new price source to the Muon Oracle. This involves modifying the function to fetch prices from the new source and then integrating it with the existing price fetching function. The repo to modify can be found herearrow-up-right. Here's the relevant code to modify if the market isn't available on Binance, Kucoin or MEXC:

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
};s

Step 2: Make a Pull Request

Once the necessary changes are made to the Muon Oracle, the next step is to create a pull request to integrate these changes into the SYMMIO codebase. Ensure that your pull request includes:

  • A detailed description of the changes made.

  • Any dependencies or configurations required for the new symbol.

Step 3: Add the Symbol to Solver Endpoints

Update your solver API endpoints to include the new symbol. This ensures that the frontends are made aware of the new markets you've made available for users to trade.

Step 4: Add the Market on the Contracts

This step requires a user with the SYMBOL_MANAGER_ROLE. In v0.8.5, symbols now have an associated symbol type which is used to categorize markets and control which solvers can trade them.

Option A — Add with type in one call using addSymbolsWithType():

Option B — Add the symbol first, set the type separately:

Note: Adding symbols on the contracts is still permissioned (requires SYMBOL_MANAGER_ROLE) However, the solver-side steps that follow (whitelisting) are fully self-service.

Step 5: Whitelist the Symbol for Your Solver (Party B)

Once the symbol exists on the contracts, the solver (Party B) needs to opt in to trading it. This step is — either the Party B address itself or an account with the PARTY_B_MANAGER_ROLE can perform it.

You have two approaches:

Whitelist by symbol type — opt in to an entire category at once:

This means any current or future symbol with symbolType = 1 is automatically accepted.

Whitelist individual symbols — opt in to specific symbols only:

De-Listing a Market

Step 1: Announce the Delisting

The first step in de-listing a market is to communicate the upcoming changes to both frontends (FEs) and users. This includes announcing:

  • The specific markets that will be delisted.

  • The date when the delisting will take effect.

  • Any other relevant information such as the last date to open new positions in these markets.

Step 2: Stop Accepting New Positions

After the announcement, you should ensure that no new positions are accepted for the markets that are scheduled for delisting. This can be internally achieved by modifying the relevant API endpoints so that these markets are no longer accepting quotes.

Remove individual symbols from your whitelist:

Remove an entire symbol type from your whitelist:

Blacklisting specific symbols: useful if the symbol's type is still whitelisted but you want to exclude individual symbols:

Step 3: Activating the Emergency Status

In the current implementation, there is a function that allows the admin to activate and deactivate the emergency status of your partyB. This emergency status enables you to manage the closing of existing positions for the delisted markets.

To do this:

  1. Activate Emergency Status: Use the contract to activate the emergency status for the relevant markets. This should be done once the delisting date is reached or as part of the delisting process.

  2. Close Positions: Existing positions should be closed using the Muon market price as the settlement price. After delisting, the Muon market price will default to the settlement price of Binance. You typically have a one-month window after the delisting to ensure all positions are closed in an orderly fashion. Information on how the settlement price is calculated can be found herearrow-up-right (Binance)

Last updated