Thanks @Gaius_sama and everyone in the Astar community who supported this initiative! Sorry I’ve been silent for two weeks – I’ve been working every night to set up Chopsticks and verify the correct extrinsics to perform the deposit. Now we’re ready to roll.
First, here are the limitations I discovered:
- only 100k ASTR can be deposited or withdrawn at a time, which would require 54 separate deposits.
- HydraDX integrates a
scheduler
pallet which could be used to perform the 54 deposits. But it can only be called from HydraDX governance and not by normal accounts. Plus that would result in 54 NFTs for the LP positions, making it more difficult to see cumulative stats for the deposit in the future.
- Astar does not have the
scheduler
pallet integrated.
- In the HydraDX code, I noticed there’s an existential deposit of 0.147 ASTR. Therefore I’d suggest sending slightly more than the 5.4M ASTR.
Therefore the options to achieve this 5.4M ASTR deposit into the Omnipool are:
- manually perform 54 multisig transactions from multisig on Hydra or on Astar or from Astar governance. All sound painful.
- Hydra governance perform this large deposit for the Astar community.
Pro: not painful, results in only one more liquidity NFT for easier monitoring.
Con: another chain’s governance can’t yet fully control Omnipool deposits via governance yet.
- Hydra chain allows normal accounts to use the scheduler pallet. (not available for the forseeable future)
Therefore after discussion with the Hydra team we’ll pursue #2 and use Hydra governance to complete the 5.4M ASTR deposit. Astar governance can still issue XCM messages in the future to remove the liquidity and bring it back to the Astar treasury; you just have to remove it 5% at a time (again, per-block rate limits).
Finally, I learned that the Astar team had planned to use an Astar-team multisig on the Hydra chain to hold the funds/LP. However, when HydraDX performed the initial ASTR liquidity deposit into the Omnipool they moved the resulting LP NFT into the Astar Sibling account on Hydra instead of to the Astar-team multisig. Looking at each proposal I don’t see the address for that multisig account so it doesn’t seem very discoverable/transparent, whereas the Astar Sibling account is easy to find using tools like https://www.shawntabrizi.com/substrate-js-utilities/ and https://polkadot.subscan.io/tools/format_transform. Therefore for this operation I would suggest the ASTR funds be sent to the Astar sibling account and from there deposited into the Omnipool instead of being routed through a multisig.
Here is the call to move this additional 5.4M ASTR liquidity from the Astar Treasury into the Astar Sibling acct on HydraDX:
0x330203010100c91f03000101007369626cd60700000000000000000000000000000000000000000000000000000304000000001f0000d012d9cbb7ab7f770400000000
where Astar Sibling acct public key is: 0x7369626cd6070000000000000000000000000000000000000000000000000000
Then HydraDX governance will deposit the 5.4M ASTR into Omnipool using:
0x0d020c4101090000000188130000e80300000d0301017369626cd60700000000000000000000000000000000000000000000000000003b0209000000000000ffcf8529967e7704000000000041010900000001f401000010270000
where Astar Sibling acct on HydraDX is: 7LCt6dFnHxYDyomeCEC8nsnBUEC6omC6y7SZQk4ESzDpiDYo
and is visualized as “SIBLING 2,006”.
In the future you can call uniques.account(7LCt6dFnHxYDyomeCEC8nsnBUEC6omC6y7SZQk4ESzDpiDYo,1337)
to get the IDs for the liquidity deposits in the Omnipool. You can also use omnipool.positions(2011)
to see the specific number of shares in that ASTR LP position.
When withdrawing the LP, you can only withdraw 5% of the overall ASTR liquidity at a time. Here is the Hydradx call to withdraw 1% (2.2k) of one of that LP position:
0x3b03db070000000000000000000000000000ba35f4c4b7a54f6e93d6010000000000
Wrapped as an XCM transaction issued from the Astar chain, the call is:
0x330003010100c91f03180b0101006d6f646c70792f7472737279000000000000000000000000000000000000000000040001000002286bee130001000002286bee0006010700e40b5402821a0600883b03db070000000000000000000000000000ba35f4c4b7a54f6e93d6010000000000140d0100010100591f
As a result of this investigation:
I’ve proposed these feature requests to the Hydra team:
-
Allow normal accounts to use the scheduler
pallet.
-
On the account liquidity page where it shows the value of that account’s LP deposits, if there are multiple deposits/NFTs of the same token then also show a cumulative stat view. This will be valuable for taking screenshots of LP stats for communities to monitor how their treasury’s deposits are doing. (instead of seeing 50 individual LP positions and manually summing them up each time)
Suggestions for the Astar team – please integrate the scheduler
pallet, which would enable Astar treasury to perform more complex transactions on other chains.
Tl;dr – Astar treasury should send the 5.4M ASTR to the Astar Sibling account on HydraDX chain. Then HydraDX governance will execute adding the ASTR liquidity to the Omnipool.