Trade Settlement
Key Stages:
Registration: Operators, Traders, and LPs register with the Dextr platform.
Trade Execution:
Traders submit on-chain intent to the registry.
LPs provide on-chain liquidity via liquidity positions.
Oracle price feeds are used to determine the current market price.
Dextr's off-chain order-matching engine efficiently prioritizes and matches trades between traders and LPs according to price, liquidity, and LP rank.
On-chain settlement occurs through Dextr AVS.
Transaction Validation:
Only the trader or LP who is directly involved in a transaction has the right to initiate a challenge regarding that specific trade.
When a challenge is raised, the challenger requests a ZK proof via Zk Coprocessor to substantiate their claim.
The ZK proof is generated to verify the correctness of the trade execution.
Slashing:
Underwriter Pool Slashing: Upon successful verification of the ZK proof, up to 5% of the TVL can be slashed from the underwriter pool.
Insurance Pool Slashing: If the financial impact exceeds the 5% threshold of the TVL in the underwriter pool, any additional amount needed is taken from the insurance pool.
Challenger Slashing: If no proof is generated or verified, the challenger loses a set amount of DXTR tokens to discourage frivolous challenges.
Compensation:
When a challenge is upheld, the slashed funds are awarded to the affected trader or LP.
If the challenge is dismissed, the tokens slashed from the challenger are moved to the insurance pool.
LP Eligibility and Priority
In Dextr, liquidity prioritization follows a structured framework based on specific criteria:
Eligibility Criteria:
Active Range: Only LPs with active price ranges relevant to the current Oracle Price are eligible.
Available Liquidity: LPs with liquidity balances exceeding 10% of the order size are considered eligible.
LP Priority:
Fee Discount Offered Priority: LPs offering the highest fee discounts on LP fees receive priority in trade settlement, ensuring competitive prices for traders.
REP Points Priority: When multiple eligible LPs offer the same fee discount, priority is given to those with higher REP Points balances.
Equal REP Points Balance Rule: If multiple LPs have the same REP Points balances, trade settlements are equally distributed among the first 10 LPs based on their Liquidity Position creation order.
Fee Distribution:
Fees are distributed solely to LPs who settle the trade.
If a single LP settles the trade alone, they retain 100% of the offered discounted fee
When multiple LPs settle the trade, fees are split based on the settled trade value.
Formula for LP Fee Calculation:
Here's the formula rewritten:
This formula calculates the LP Fee based on the Order Quantity, Fee Discount percentage, and the number of Liquidity Providers (LPs) involved in the transaction.
Directly Matched Trades (DMT)
If no eligible LPs match the user's intent, the AVS checks for "Coincidence of Wants" (CoW), where another trader has a complementary intent (e.g., selling the token the first user wants to buy at the same price).
If Coincidence of Wants Exists:
The intents are matched directly without LP intervention.
Token balances for both users are updated in their modular smart accounts.
Only the protocol fee is applied; no LP fee will be charged from the trader since LPs are not involved in executing this trade.
If No Coincidence of Wants Exists:
In the absence of a CoW, the AVS searches external liquidity sources via aggregator services for a matching or better price.
If a suitable price is found, the transaction proceeds by withdrawing sell tokens from token vaults, depositing buy tokens into respective vaults, and updating user balances.
Only the protocol is be applied; no LP fee is charged since LPs are not involved in executing this trade.
If suitable price is not found, the user's intent remains open in the registry.
Additional fees may be applicable when external liquidity sources are involved. These fees may be charged by the liquidity aggregators and liquidity sources.
Last updated