blockworks-foundation / mango-explorer

A project to explore and provide useful code for Mango Markets (https://mango.markets/).
MIT License
155 stars 87 forks source link

`mango-explorer` 'Exception: Cannot find base token or perp market' on devnet #16

Closed juicedgrapefruit closed 2 years ago

juicedgrapefruit commented 2 years ago

It was working last Friday, but throwing exceptions today on devnet. It still works on mainnet.

~$ mango-explorer show-account-balances --cluster-name devnet
2021-12-13 03:49:08 ⚠ root         
⚠ WARNING ⚠

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    🥭 Mango Markets: https://mango.markets
    📄 Documentation: https://docs.mango.markets/
    💬 Discord: https://discord.gg/67jySBhxrg
    🐦 Twitter: https://twitter.com/mangomarkets
    🚧 Github: https://github.com/blockworks-foundation
    📧 Email: mailto:hello@blockworks.foundation

Traceback (most recent call last):
  File "/app/bin/show-account-balances", line 30, in <module>
    group: mango.Group = mango.Group.load(context)
  File "/app/mango/group.py", line 343, in load
    return Group.parse(account_info, name, context.instrument_lookup, context.market_lookup)
  File "/app/mango/group.py", line 328, in parse
    return Group.from_layout(layout, name, account_info, Version.V3, instrument_lookup, market_lookup)
  File "/app/mango/group.py", line 295, in from_layout
    raise Exception(f"Cannot find base token or perp market for index {index}")
Exception: Cannot find base token or perp market for index 10
roelantc commented 2 years ago

What does the command mango-explorer account-scout return for you? Because I have the same problem and there seems to be an error that says that the root account does not exist.

juicedgrapefruit commented 2 years ago

Same as you @roelantc

~$ mango-explorer account-scout
2021-12-13 09:54:07 ⚠ root         
⚠ WARNING ⚠

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    🥭 Mango Markets: https://mango.markets
    📄 Documentation: https://docs.mango.markets/
    💬 Discord: https://discord.gg/67jySBhxrg
    🐦 Twitter: https://twitter.com/mangomarkets
    🚧 Github: https://github.com/blockworks-foundation
    📧 Email: mailto:hello@blockworks.foundation

2021-12-13 09:54:07 ⓘ root         Address: 24t3j6icnrTnmVLnfU98Tcs7WhQ21hQ6pDioUca4RNkU
« ScoutReport [24t3j6icnrTnmVLnfU98Tcs7WhQ21hQ6pDioUca4RNkU]:
    Summary:
        Found 1 error(s) and 0 warning(s).

    Errors:
        Root account '24t3j6icnrTnmVLnfU98Tcs7WhQ21hQ6pDioUca4RNkU' does not exist.

    Warnings:
        None

    Details:
        None
OpinionatedGeek commented 2 years ago

Apologies. It looks like a new market was added to the devnet group, and the details of it aren't in the mango-explorer version of the ids.json file yet.

The fix will require a new release, so when I've made the change I'm afraid you'll need to update.

roelantc commented 2 years ago

Ah check, no problem. Thanks for the quick response!

juicedgrapefruit commented 2 years ago

Apologies. It looks like a new market was added to the devnet group, and the details of it aren't in the mango-explorer version of the ids.json file yet.

The fix will require a new release, so when I've made the change I'm afraid you'll need to update.

Thank you for the quick update. Would you mind sharing the latest ids.json so we can monkey patch it temporarily?

OpinionatedGeek commented 2 years ago

Sure - the 'master' is always: https://github.com/blockworks-foundation/mango-client-v3/blob/main/src/ids.json

You should probably delete or move the 'devnet.3' group - that's not the group that's actively used on devnet.

OpinionatedGeek commented 2 years ago

I've just pushed the new release so it should work for you once you've fetched the latest code.

Apologies again.

juicedgrapefruit commented 2 years ago

Thank you!