Closed joemccann closed 2 years ago
There should be some error output before that, and that should describe the root problem. Can you share that?
If you're not seeing any error output before that, can you try passing the parameter --log-level INFO
as well as the other parameters?
The 'is not prepared for group' is a general exception thrown after the AccountScout
performs a bunch of checks and generates a report with errors and warnings. The liquidator can still run if there are some warnings, but errors mean there's a problem somewhere we need to deal with before the liquidator can safely, properly run.
Thanks for such a quick reply!
Here's the full output:
N|S /var/ mango-explorer liquidator --target "BTC:33%" --target "ETH:33%" --dry-run
2021-08-10 16:25:23 โ 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-08-10 16:25:23 โ root Context: ยซ ๐ฒ๐๐๐๐๐ก๐:
Cluster: mainnet-beta
Cluster URL: https://solana-api.projectserum.com
Program ID: 5fNfvyp5czQVX77yoACa3JJVEhdRaWjPuazuWgjhTqEH
DEX Program ID: 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin
Group Name: BTC_ETH_SOL_SRM_USDC
Group ID: 2oogpTYm1sp6LPZAWD3bp2wsFpnV2kXL1s52yyFhW5vp
ยป
2021-08-10 16:25:23 โ root Wallet address: Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT
2021-08-10 16:25:23 โ root Checking wallet accounts.
2021-08-10 16:25:39 โ root Wallet account report: ยซ ScoutReport [Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT]:
Summary:
Found 2 error(s) and 2 warning(s).
Errors:
Account 'Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT' has no account for token 'Wrapped SOL', mint 'So11111111111111111111111111111111111111112'.
Account 'Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT' has no account for token 'Serum', mint 'SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt'.
Warnings:
No Serum open orders account for market 'Wrapped SOL/USD Coin' [9wFFyRfZBsuAha4YcuxcXLKwMxJR43S7fPfQLusDBzvT]'.
No Serum open orders account for market 'Serum/USD Coin' [ByRys5tuUWDgL73G8JBAEfkdFf8JWBzPBDHsBVQ5vbQA]'.
Details:
Account 'Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT' has 1 Wrapped Bitcoin (Sollet) token account(s) with mint '9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E': [3C2ADDY4wy3n7ZHoEnBxLedAzTNe5aiJfT655LdkcdaY]
Account 'Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT' has 1 Wrapped Ethereum (Sollet) token account(s) with mint '2FPyTwcZLUg1MDrwsyoP4D6s1tM7hAkHYRjkNb5w6Pxk': [Fm765bTJpDe9nYbRqHgTgmPhMPy39eiCqqCT497sziGb]
Account 'Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT' has 1 USD Coin token account(s) with mint 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v': [ETrBARWJBMppYfaBw69kGzRn8J8RJX8mKWUAR4WaZnew]
Serum open orders account for market 'Wrapped Bitcoin (Sollet)/USD Coin': ยซ OpenOrders [F5Jf4GKejKhED4X3rgPRQH8dZTdMaAXi2SjPL43vQWL]:
Flags: ยซ SerumAccountFlags: initialized | open_orders ยป
Program ID: 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin
Market: A8YFbxQYFVqKZaoYJLLUVcQiWP7G2MeEgW5wsAQgMvFw
Owner: Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT
Base Token: 0.00000000 of 0.00000000
Quote Token: 0.00000000 of 0.00000000
Referrer Rebate Accrued: 144872
Orders:
None
Client IDs:
None
ยป
Serum open orders account for market 'Wrapped Ethereum (Sollet)/USD Coin': ยซ OpenOrders [8cwoi1gti8GsFYxhaEDEPqerwSvbLbhXp8kqmWFv2t6G]:
Flags: ยซ SerumAccountFlags: initialized | open_orders ยป
Program ID: 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin
Market: 4tSvZvnbyzHXLMTiFonMyxZoHmFqau1XArcRCVHLZ5gX
Owner: Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT
Base Token: 0.00000000 of 0.00000000
Quote Token: 0.00000000 of 0.00000000
Referrer Rebate Accrued: 145031
Orders:
None
Client IDs:
None
ยป
Account 'Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT' has no Mango Markets margin accounts.
ยป
2021-08-10 16:25:39 ๐ root Liquidator stopped because of exception: Account 'Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT' is not prepared for group '2oogpTYm1sp6LPZAWD3bp2wsFpnV2kXL1s52yyFhW5vp'. - Traceback (most recent call last):
File "/home/jovyan/work/bin/liquidator", line 106, in <module>
raise Exception(f"Account '{wallet.address}' is not prepared for group '{group.address}'.")
Exception: Account 'Dd8sgey2VD1uo5jBJfwJAdfi2GZAvULcoSqAy87jQGBT' is not prepared for group '2oogpTYm1sp6LPZAWD3bp2wsFpnV2kXL1s52yyFhW5vp'.
2021-08-10 16:25:39 โ root Liquidator completed.
Aha. OK. The root problem is that Mango now has 5 tokens in its Group (BTC, ETH, SOL, SRM, USDC) not the old 3 tokens (BTC, ETH, USDT). That Quickstart is a bit out of date. Sorry.
(You could just run the liquidator against the old Group - it's still there but doesn't see too much action these days. The equivalent command for you would be: mango-explorer liquidator --group-name BTC_ETH_USDT --target "BTC:33%" --target "ETH:33%" --dry-run
)
The exception is saying that you don't have SPL token accounts for SRM and Wrapped SOL. You need those accounts to exist so that if you liquidate someone, their tokens can go to your account. It's probably better to have some of those tokens in your account so you can provide them if they're needed for liquidations.
SOL is tricky because it's not a 'real' SPL token in Solana, it's the native token. To use it as an SPL token it needs to be 'wrapped' in an SPL-compatible wrapper.
Also, the quote token changed from USDT to USDC. That isn't mentioned in the error (it's likely you already have a USDC token account), but it is something you'll need to address.
So, to get up and running:
wrap-sol
Apologies for the inconvenience.
awesome thanks! I can update the walkthru in a PR if I get it running.
You are welcome to, of course, but it will need to be completely re-done for V3 anyway (happening soon!) so it may not be the best use of your time.
For who still got issue with this:
mango-explorer group-balance-wallet --group-name BTC_ETH_SOL_SRM_USDC --target "BTC:0.004" --target "ETH:0.05" --target "SOL:2" --target "SRM:20"
this one uses for Liquidator v2, cannot use percentage anymore.
Thanks - yes, the current V2 code no longer accepts percentage targets for rebalancing. (It caused problems in some situations and didn't seem worth the benefit it provided.)
Great writeup on how to run a liquidator. However, when I get to the dry run for running the liquidator I got the following exception and the liquidator terminates.
Any ideas?