2

After long Telegram conversations I have found out that MdexSwap uses a secret formula to calculate their token exchange rates on their swap platform. Unlike Uniswap they also don't really have an API, SDK or any other documentation for developers at least what I have found out after intense researching for more than a week. I have found their Github and some kind of API but that's it and as said before it doesn't make any sense to me...

1 Answer 1

3
+100

As you mentioned it seems they have a particular way of doing things, and I am not too familiar with Mdex, but I have worked with Uniswap's sub-graph implementation. This isn't necessarily a solution to your question but may help you get there.

After looking into https://info.mdex.com I spotted that they use a similar approach to Uniswap's sub-graph. They implement the GraphQL approach that come from TheGraph (https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2).

I came across this GraphiQL playground they have set-up (https://graph.mdex.com/subgraphs/name/mdex/swap/graphql). On the right hand-side you can explore the available queries they provide (Docs) and hopefully you can figure out what you are trying to accomplish here.

Here's a quick example of what you can achieve (GraphQL) Just paste it into the left on that GraphiQL, this gets you some pairs data with their available reserves.

query pairsData {
  pairs(first: 10) {
    id
    reserve0
    reserve1
    token0 {
      name
      symbol
    }
    token1 {
      name
      symbol
    }
  }
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.