Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 Default Protocol Status should be in a config.json #549

Closed
esteblock opened this issue Sep 23, 2024 · 0 comments · Fixed by #551
Closed

3 Default Protocol Status should be in a config.json #549

esteblock opened this issue Sep 23, 2024 · 0 comments · Fixed by #551
Assignees

Comments

@esteblock
Copy link
Member

esteblock commented Sep 23, 2024

Currently we have in

const getDefaultProtocolsStatus = async (network: Networks) => {

  const getDefaultProtocolsStatus = async (network: Networks) => {
    switch (network) {
      case Networks.PUBLIC:
        // here you should add your new supported protocols
        return [
          { key: Protocols.SOROSWAP , value: getValuebyKey(Protocols.SOROSWAP) },
          { key: PlatformType.STELLAR_CLASSIC, value: getValuebyKey(PlatformType.STELLAR_CLASSIC) },
        ];
      case Networks.TESTNET:
        return [
          { key: Protocols.SOROSWAP, value: getValuebyKey(Protocols.SOROSWAP) },
          { key: Protocols.PHOENIX, value: getValuebyKey(Protocols.PHOENIX) },
        ];
      default:
        return [
          { key: Protocols.SOROSWAP, value: true },
          { key: Protocols.PHOENIX, value: false },
          { key: PlatformType.STELLAR_CLASSIC, value: true },
        ];
    }
  }

Also, al protocols are defined in

import {
Protocols,,
} from 'soroswap-router-sdk';

This is not elegant.

We want:

1.- Get Protocols from 'soroswap-router-sdk';
2.- For every protocol in Protocols, check if exist in config.json

config.json should be like this:

mainnet{
classic: true
soroswap_amm:true
phoenix: false}

testnet{
soroswap_amm:true
phoenix: true}

3.- If a protocol DOES NOT exist in config.json it will not even be considered in the Configuration Settings
4.- If a protocol DOES exist but is in FALSE. It will be allowed, and disabled by default
5.- If a protocol DOES exist but is in TRUE. It will be allowed, and ENABLED by default

At the same time, after finishing #548 Check that

  • If AGGREGATOR_ENABLED_MAINNET= false it will only look for classic and soroswap
  • If AGGREGATOR_ENABLED_TESTNET= false it will only look for soroswap
@esteblock esteblock changed the title Default Protocol Status should be in a config.json 3 Default Protocol Status should be in a config.json Sep 23, 2024
@MattPoblete MattPoblete linked a pull request Sep 26, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from To TEST to Done in Soroswap.Finance Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants