Orderbook v2, THEA, and Crowdloan Rewards now live on Kaizen

Polkadex Orderbook v2 is ready for testing ahead of the v1 to v2 mainnet migration scheduled to start this coming Monday. Polkadex’s THEA interoperability layer and the Crowdloan Rewards claiming page are also now available on Kaizen.

Polkadex
9 min readJun 8, 2023

Things are heating up here at Polkadex. Today, we are releasing the biggest update to Kaizen, the Polkadex testnet, yet. Today’s testnet launch is an important milestone in the buildup to the upcoming launch of Polkadex Orderbook v2 on the Polkadex mainnet, the launch of THEA, the connection between the Polkadex parachain and the Polkadex solochain, and the release of the Polkadex Crowdloan rewards. However, it is not only a tease of what is coming very soon, but also a testament to all the hard work the Polkadex team has been doing behind the scenes these last few months.

Now available on Kaizen

On the frontend side, Polkadexers will get to not only play around with the Orderbook, but they’ll also be able to test the user interface for THEA, which includes the Polkadex Parachain connection and an open XCM channel with Moonbase Alpha (Moonbeam’s testnet).

THEA interface

The most savvy Polkadexers will even see the Polkapool backend implemented into the latest Kaizen release. Last but not least, Polkadex Crowdloan contributors will also be able to do a test run-through of the PDEX rewards claiming process.

For guides on how to test all the different features of today’s launch, please scroll down past the section break at the end of this article.

Orderbook v2

The main update to Kaizen, however, is Orderbook v2. While the user interface of Orderbook v2 will look and feel very similar to the current v1, it’s a completely different beast under the hood. When we launched v1, we were successful in building a non-custodial order-book based exchange capable of scaling to high-frequency-trading speeds. However, we were limited by the technology available to us at that time. This resulted in an architecture which relied on enclaves, or centralized pieces of hardware maintained by the exchange operators (in this case, Polkadex), which meant “snapshots” of the current state (including trading account balances at any given time) were centrally maintained. While this did not affect the day-to-day user experience in a meaningful way, it did make Polkadex Orderbook more reliant on the operator, especially in fringe cases where recovery mode might need to be enabled by the governance council. Ultimately, v1 was a secure but not optimal solution. We needed a technological breakthrough in order to remove the operator’s responsibility for state snapshots and make sure potential recoveries were not reliant on centralized snapshots.

We achieved that breakthrough in February of this year. In a testament to Polkadex’s commitment to research & development, we were able to completely remove the enclave out of the Orderbook architecture and replaced it with a client-side, validator-run program (orderbook-worker). With Polkadex Orderbook v2, all trades and balances are now maintained by Polkadex validators, thereby inheriting the same level of security as the runtime (on-chain state).

How does the new v2 architecture work?

In short, all trades and other relevant messages from the Orderbook engine, like deposits and withdrawals, are sent to this worker. The Polkadex validators gossip these messages around and verify user balances until reaching consensus. At that point, validators will generate a “snapshot” of the current state–including user balances at that point in time–and send it to the chain. Once it is finalized on-chain, the user balances in the snapshot are also finalized and can never be reverted.

Thanks to v2, full nodes have the latest on-chain state, which means that if the exchange operator were ever to be compromised, Orderbook users could recover balances by running a full node (and getting the on-chain governance to switch to that full node). The recovery method in this case would roughly be as follows: on-chain council loses trust in the exchange operator and votes to enable recovery mode, recovery mode removes the operator, and the on-chain council decides whether to set up a new operator or trigger withdrawals from trading accounts in the Orderbook pallet to users’ main accounts.

v2 is just the beginning

v2 will provide Polkadex Orderbook with the reliable backend it needs right before the listing of DotSama market pairs begins. Pending a runtime upgrade, a mainnet deployment of Orderbook v2 along with THEA is currently scheduled for the back half of June. Work on listings will take place in parallel as the recently upgraded Polkadex parachain begins the process of connecting to other Polkadot parachains via XCM channel openings.

Polkadex Orderbook v1 to v2 Migration

In the meantime, the current version of Polkadex Orderbook (v1) will go offline on June 12th as the exchange migrates to v2. For current Polkadex Orderbook users, this means all open orders will be cancelled and any remaining funds currently on your trading account will be withdrawn automatically into your main account (aka your Polkadex address). If you have cUSDT (USDT bridged from Ethereum via ChainBridge), you may either trade it to PDEX before June 12th or use the ChainBridge option on the Token Manager interface to return your USDT to your Ethereum address before August.

Hot on the heels of yesterday’s v5.0.0 release, today’s testnet launch is another important step on the way to a truly interoperable liquid order-book based, non-custodial exchange for all crypto traders. Whether you’ve been a Polkadexer since day one or you have just discovered what we are building, we thank you for all your support as we attempt to bring forth a new era of trading.

💹 Website | Polkadex Orderbook | Token Manager

🌐 Twitter | TG Chat | TG Announcements | Medium | Youtube | Reddit | Discord | Linkedin | Spanish community | Turkish community | Indian community | Russian community | Chinese community | German community

Testing guides

Polkadexers can test everything in this new testnet release at their own convenience. You can even earn rewards based on your feedback as part of the Polkadex Open Beta program! Here is a list of the links you will be using for testing:

Before you get started with any of the tests below, be sure to use your Polkadot.js extension-enabled Polkadex account to get some test PDEX from the test token faucet.

Testing THEA

In order to test the THEA interface and backend, you will do an XCM transfer from Moonbase Alpha to the Polkadex solochain (via the Polkadex parachain) and back. In other words, you will deposit and, later, withdraw test GLMR from Moonbase Alpha to Polkadex and back.

THEA deposits

  1. If you don’t have one already, create or import an Ethereum/Moonbase Alpha account onto your Talisman wallet extension. You can download Talisman here.
  2. Get some test GLMR from the Moonbase Alpha test token faucet.
  3. Open THEA
  4. Choose the Deposit tab on the top navigation bar.
  5. Click on ‘From’ and choose the Moonbase Alpha network as the source network
  6. Tap ‘Select Wallet’ and choose your Ethereum Account with existing test GLMR token balance.
  7. The Polkadex testnet (Kaizen) is in the ‘To’ section as the default destination network. Tap ‘Select Wallet’ and choose your Polkadex account loaded with test PDEX from the drop-down menu.
  8. Enter the amount of test GLMR you’d like to transfer to the Polkadex network and click Deposit, then confirm the transaction by clicking ‘Confirm Transaction’ in the right side pop-up.
  9. After clicking on Confirm Transaction and Approving the request on the Talisman Pop-up, your XCM transfer from Moonbase Alpha to Kaizen, or the Polkadex solochain (via the Polkadex testnet parachain) will be initiated.
  10. After a few minutes, you will see the transaction under the Transactions tab on the top navigation bar. If it doesn’t show up automatically, click on the refresh button to the right of the page. If you still don’t see it, refresh the entire page.
  11. Once you see your transaction in the list, you will see the status as ‘(½) Approved’ and an orange ‘Claim Deposits’ button to the right of the screen.
  12. Click on the ‘Claim Deposits’ button and sign the Polkadot.js message.
  13. After a couple of minutes, you will see the status change to ‘(2/2) Claimed’.
  14. Congratulations! You’ve successfully transferred tokens from ‘Moonbase Alpha’ to ‘Polkadex.’ You can see this reflected in your balance in the Assets tab.

THEA withdrawals

  1. Click on the Withdraw tab on the top navigation bar
  2. The ‘From’ network is chosen as Polkadex by default. Make sure to click on the ‘From’ section to connect with whichever Polkadex wallet has your test GLMR in it
  3. Click the ‘To’ drop-down and select Moonbase Alpha.
  4. On the right side of the screen, click ‘Select Wallet’ to select the Moonbase Alpha account you would like to transfer your tokens to.
  5. Enter the amount you’d like to transfer back and click on ‘Confirm Transaction’ on the popup window that will open on the right side of the screen.
  6. Sign the message that pops up on the Polkadot.js window.
  7. You will see a success message once the transaction starts being processed on the blockchain(s). After a couple of minutes, you can check your updated balance in the Assets tab.
  8. You have now successfully transferred your test GLMR from Polkadex back to Moonbase Alpha. You can also track the balance of your Moonbase Alpha test network account during the deposit and withdrawal processes on the Polkadot.js apps explorer for Moonbase Alpha.

Testing Orderbook

  1. Open Polkadex Orderbook
  2. Login using an existing account or sign up.
  3. Register your account for trading in the Accounts tab
  4. Navigate to the Balances tab and deposit some test GLMR and PDEX from your Kaizen account to Polkadex Orderbook
  5. In the Exchange tab, place buy and sell limit and market orders to ‘trade’ your test tokens.
  6. Take note of the order matching, the graph with real-time updates, check order and trade histories, and even cancel open orders.
  7. Withdraw back to your Kaizen account from the Balances tab.

Testing Crowdloan rewards

Please note that there are two different ways of claiming your Crowdloan rewards. While both are listed below, you will only be able to claim using one of the methods as you cannot claim your rewards more than once.

Claiming page

  1. Visit the Crowdloan rewards page.
  2. Make sure your Polkadot.js extension wallet is set to “Allow use on any chain” and make sure you have a balance of over 1 test PDEX in your wallet.
  3. Select the account you contributed to the Polkadex Crowdloan with from the drop-down menu to connect.
  4. The interface will show you the total rewards for this address, the amount of rewards that are claimable, and the ones you have already claimed. Please note that the amount of claimable rewards will be significantly higher when you follow this process on mainnet as it will account for all the vesting since the start of the lease period.
  5. Click ‘Unlock’ to initialize your claim and confirm the transaction on your wallet extension.
  6. Click ‘Claim’ to trigger to unlock your claimable rewards and confirm the transaction on your wallet extension.
  7. You’ve claimed your Crowdloan rewards on the testnet! Now you’re ready to do the same when the rewards are available on mainnet!
  8. If you want to stake your Crowdloan rewards, click on ‘How to Stake’ for a quick tutorial.

Polkadot.js apps

  1. Navigate to the Accounts page in the Polkadex.js explorer and double check that the account you contributed to the Polkadex Crowdloan with has an existential balance of 1+ test PDEX in it.
  2. From the Developer drop-down menu, select Extrinsics.
  3. Select the ‘rewards’ extrinsic from the drop-down menu and select ‘InitializeClaimRewards’ to initialize the rewards the first time you are claiming. Enter the rewardid id as 1 and submit the transaction by signing the pop up message.
  4. Once you successfully initialize the rewards by signing the message, select the ‘claim’ options under the rewards extrinsic and enter the reward id as 1. Once you sign the pop up message, all the rewards available to you up until that block will be claimed and unlocked in your account.
  5. Congrats, you’ve claimed your Polkadex Crowdloan rewards on testnet and are now ready to do the same when they become available on mainnet!

--

--

Polkadex

⛓Cutting edge orderbook based DEX built on Substrate 📲 www.polkadex.trade