Darwinia Apps Guide Part VⅠ: Fee Market Analytics

Understanding Darwinia Fee Market

The calculation of fees for cross-chain messages usually requires the consideration of the token value exchange ratio between the source and target chains on the blockchain, which is what Oracles normally do. Unlike Oracles, the fee market mechanism does not require the chain to be aware of the token value exchange ratio between the source and target chains in real time, but relies on the relayers‘ quotes to generate the final cross-chain fee.

The relayer is the third off-chain role of the message carrier, responsible for delivering messages between the source and target chains. Before delivering a message, the relayer calculates its own costs and expected profits by combining the transaction fees of the source and target chains and finally submits its own quote to the fee market. When the fee market has received enough quotes, it selects a suitable quote as the cross-chain fee at that moment according to the pre-defined rules.

To see the Fee Market in a clear visual way, Darwinia Apps launched Fee Market Analytics. Let’s see how to use it.

Using Fee Market Analytics in Darwinia Apps

Position of Fee Market in Apps

You can find the Fee Market Analytics on the Apps sidebar, and access them as shown below. 👇🏻

Apps

The unimplemented functions in Polkadot Apps

apps.darwinia.network

Since the Fee Market is built based on a specific source chain and target chain as the minimum unit, we will first need to switch to the corresponding market to view the data. In Apps, the network option on the sidebar (left side, labeled 2️⃣) is used as the source chain of the Fee Market, and the option on the right side (labeled 3️⃣) is the corresponding target chain.

Take the following screenshot for instance, we are looking at the Fee Market Data with Crab as the source chain and Darwinia as the target chain. Crab here represents Crab Chain and Crab Smart Chain, Darwinia represents Darwinia Chain and Darwinia Smart Chain.

💡 The statistics on the Fee Market Analytics are calculated based on the specific source network and target network selected.

Overview Page

We can picture the overall development of the Fee Market and the current state through the data presented on the Overview Page.

Statistics

Refer to the above screenshot (card labeled 4️⃣)

Total Relayers — The first number represents the number of currently active relayers in the current Fee Market. And the second number represents the number of all registered relayers. Active Relayers’ collateral should be higher than the required collateral threshold.Average Speed — The average speed of the orders in this Fee Market.Current Message Fee — Fee that you need to pay if you initiate a cross-chain message order during this time. Every time the Fee Market receives a cross-chain message on the blockchain, it generates an order, to manage the process of a cross-chain message. The orders record the cross-chain messages‘ creation time, confirmation time, fee distribution, etc.Total Rewards — Total rewards earned by all relayers from this Fee Market.Total Orders — Total cross-chain message orders created in this Fee Market.

Charts

Refer to the above screenshot (cards labeled 5️⃣ 6️⃣)

The card labeled 5️⃣ is the Order Quantity by Day chart, where we can picture the usage of cross-chain messages over the fee market.

The card labeled 6️⃣ is the Message Fee History by Order chart, in which we can see fee prices for cross-chain messages at different times.

Relayers Page

The Relayers Page allows you to see the statistics of all relayer offers, collateral, earnings, penalties, orders, etc. It helps relayers or those interested in becoming relayers to post their proper quotes based on the reference fee and the expected profit.

List

Relayers Page is divided into two tabs All Relayers and Assigned Relayers.

All Relayers includes a list of all currently registered relayers in this fee market.Assigned Relayers includes a list of n relayers with the lowest quotes. After all the intended relayers have made their quotes, the system will sort the prices in ascending order and select the lowest n quotes. For the current Fee Markets, n is 3. They are jointly responsible for this cross-chain message: If the message crosses the chain on time, the assigned relayer will be rewarded with a higher percentage. If not, all the assigned relayers will be punished for the failure.

Count(orders) — The number of orders in which the relayer is involved. The way to get involved can be as any role of Assigned Relayer, Delivery Relayer, or Confirmation Relayer. The 3 roles will be explained in the next paragraph of this article.Collateral — The amount of tokens the relayer has locked on the chain. The Fee Market requires relayers to lock a certain amount of tokens on the chain as collateral to prevent failure and malpractice.Quote — The quotation posted by the relayer. The relayer posts their quotes based on the reference price and the expected profit on the blockchain. The currently highest quote of the Assigned relayers would be the Current Message Fee.Sum(reward) — The total amount of reward received by the relayer.Sum(slash) — The total amount of fines imposed on the relayer.

By clicking on the relayer’s account, we navigate to its details page. Let’s see what we get.

Details

Reward & Slash Chart — It shows how much one relayer gets rewarded or slashed by day. By comparing the two bars, you can visually see whether the relayer is more penalized or more rewarded.Quote History — It shows the history of the relayer‘s quotes.Involved Order List — This list shows all the orders that the relayer has participated in, including the rewards and penalties that each order has generated for him.

Let’s explain the three Relayer Roles we mentioned earlier. They are a bit confusing.

The core of cross-chain technology is the delivery and confirmation of the message. So roughly splitting the cross-chain process into 2 phases, would be {Delivery Phase} and {Confirmation Phase}.

Delivery Relayer It's the relayer who undertakes the work on the Delivery Phase. It can be the Assigned Relayer or just any other registered relayer.

Confirmation Relayer It's the relayer who undertakes the work on the Confirmation Phase. It can be the Assigned Relayer or just any other registered relayer.

Assigned Relayer As we have described in the previous part, the n lowest quoted relayers are the Assigned Relayers of the current orders.

They jointly take responsibility for this cross-chain message: If the message crosses the chain on time, the assigned relayer will be rewarded with a higher percentage. If not, all the Assigned Relayers will be punished for the failure.

Orders Page

On the Order Pages you can see the status distribution of the different orders, the timeout situation, as well as different specific order’s fee cost, the rewards/penalties incurred, the relayer roles involved in the order, etc. These data would be helpful for the message users to get a more detailed overview of the order and follow up on orders.

Statistics

We can see the overall orders’ status distribution on this page. Orders are divided into 3 states:

Finished — It shows how many cross-chain message orders have been finished, which means these orders have completed the {Delivery Phase} and {Confirmation Phase}.In Progress (In Slot) — It shows how many cross-chain message orders are still in progress but have not exceeded the penalty time set by the system yet.In Progress(Out of Slot) — It shows how many cross-chain message orders are still in progress but have already exceeded the penalty time set by the system. The Assigned Relayers for these orders would get penalized. Relayers and Fee Market Operators should focus on this data.

List

As we explained these indicators in the previous parts, the list could be much easier to understand. Just let me make some explanation about the filtering method.

  • By Order ID/Sender Address, you can pinpoint specific orders by the ID/order initiator’s account address.

  • By Status, you can filter out the completed and in-progress orders separately.

  • By Date/Block range, you can filter out orders within the specified Date/Block range respectively.

Let me give you an example to make filtering a lot clearer. Suppose you choose the starting block to be#3042500and the ending block to be#3043507. The filtered order results’ creation block should be later than#3042500and confirmation block will be earlier than#3043507.

  • By Slot, you can filter orders in different Slots.

The assigned relayer will be highly rewarded in priority time slots, which are set by the system. Relayers with lower prices are assigned with the earlier time slot.

Let’s say the Assigned Relayers are A, B, C, and A’s quote is P1, B’s quote is P2, and C’s quote is P3. If we say P1 > P2 >P3, Slot1 represents the earliest time slot that the system set. Then Slot1 is associated with C since C’s quote P3 is the lowest and Relayers with the lower price are assigned with the earlier time slot: If the order is confirmed at Slot1 for now, C will be rewarded with a higher percentage.

💡 By combining different filter criteria you can filter for more specific results. For example, by selecting a block range and slot1 for Slot, you can filter for orders that are confirmed at the earliest time slot within a specified block range. Or, by selecting finished for Status and out of slot for Slot, you can filter how many of the completed orders have timed out.

By clicking the order ID on the list, we navigate to the order‘s detail page. Let’s see what else we get.

Detail

In the Detail Section, we can see the order’s specific information.

  • Detail Section
Nonce — The ID of the cross-chain message order.Lane ID —The ID of the message delivery lane.Time Stamp —The date and time at which the cross-chain message order was created.Source TxID —A unique 66-character identifier that is generated whenever an order is accepted on the source chain.Sender — The account that initiated the cross-chain message order.Status —The status of the cross-chain message order.Fee —The fee that users pay for the cross-chain message order.Created At— Number of the block in which the cross-chain message order was created.Confirmed At— Number of the block in which the cross-chain message order was confirmed.Slot At — Number of the time slot(which was set in the system) in which the cross-chain message order is confirmed. Out of Slot indicates the order exceeded the penalty time set by the system.Assigned Relayers — The selected relayers that are jointly responsible for this cross-chain message.
  • Reward & Slash Sections
Extrinsic —The transaction or event that the reward and slash system initiated, related to the corresponding order.The Reward Section shows how many rewards were generated by this order for different roles of the relayer, and how much would be transferred to the Treasury.The Slash Section shows the penalty of the corresponding Assigned Relayer, in case of a time-out order.

About Darwinia & Crab

Github | Website | Medium | Twitter | Telegram

Darwinia is a cross-chain messaging infrastructure, which provides a light client-based, programmable, universal cross-chain messaging network for decentralized applications. Now, we’ve successfully used Darwinia’s light-client cross-chain messaging protocol(LCMP) to bridge cross-chain messages between substrate-based chains, and even between substrate-based chains and EVM chains, meanwhile, Darwinia provides developers with the SDK, and developers can easily integrate cross-chain capabilities into their Dapps. This will have profound implications for cross-chain interoperability, and Darwinia will as a cross-chain messaging infrastructure to prompt the building of a hybrid cross-chain network for Polkadot.

Crab is a canary network with real economic value for Darwinia, positioning similar to Polkadot’s Kusama Network, which is a programmable cross-chain platform for Dapps. It is substrate-based, EVM-compatible, and connected to Kusama.

0
Darwinia NetworkPost author

Darwinia Network is a highly-secure programmable cross-chain messaging infrastructure for decentralized applications. Our light-client cross-chain messaging protocol (LCMP) supports arbitrary message passing between Substrate chains, and between Substrate and EVM chains, and SDK empower developers with the tools necessary to build the next generation of Web3 applications and seamless user experiences even when transacting across multiple chains or protocols.

Darwinia as a cross-chain messaging infrastructure will facilitate the building of a hybrid cross-chain network for Polkadot.

Follow us: linktr.ee/darwinianetwork

Darwinia Network is a programmable cross-chain messaging infrastructure for decentralized applications. Our light client-based cross-chain messaging protocol (LCMP) supports arbitrary message passing between Substrate and EVM chains, and SDK empowers developers with the tools necessary to build the next generation of Web3 applications, and create seamless user experiences, even when transacting across multiple chains.

Follow us: linktr.ee/darwinianetwork

0 comments

Darwinia Network is a programmable cross-chain messaging infrastructure for decentralized applications. Our light... Show More