Portal's ADMM: A new way of reimagining AMMs

Janesh Balchandani

Jan 17, 2024

Decentralized Exchanges (DEXs) have undergone a significant evolution in recent years. Portal brings a paradigm shift with its Automated Dynamic Market Maker (ADMM) Protocol. This innovative protocol challenges existing industry norms, especially in handling complex cross-chain transfers. In this article, we delve into the key aspects of the Portal ADMM, understanding its unique features, operational logic, and the intricate flow of swap transactions.


Introduction:

The DeFi landscape has witnessed a surge in decentralized exchanges, with innovative protocols like ADMM redefining liquidity provision strategies. Portal DEX introduces a paradigm shift, prioritizing capital efficiency and pricing accuracy for users engaging in complex cross-chain transfers. 

ADMM Swaps and Protocol Overview:

The ADMM protocol introduces a dynamic market-making approach, aiming to optimize liquidity provider strategies. Its unique traits set it apart in the market, promising advantages in terms of capital efficiency and pricing accuracy. The acronym ADMM stands for Automated Dynamic Market Maker, underscoring its automated and adaptive nature.


Cross-Chain Swaps:

Illustrating the cross-chain capabilities of ADMM, let's consider a practical example: swapping ETH/ERC-20 on Ethereum L1 with BTC on the Lightning L2. The Ethereum L1 hosts a "DEX Contract" account overseeing the initiation, execution of swaps, and compensating validators and liquidity providers (LPs). This enables seamless interoperability between different blockchain networks.

Non-Custodial and Atomic Swaps:

Portal DEX implements non-custodial and atomic swaps, ensuring that until the successful completion of a swap, the custody of a trader's assets is not transferred to any party. Atomic swaps guarantee that either the swap occurs, with assets exchanged between traders, or both parties retain their original assets. This enhances security and trust in the swapping process.

Components and Participants:

Traders interact with the Portal DEX, initiating swaps that are facilitated by Liquidity Pools managed by the ADMM smart contract on the Notary Chain. Validators, operating nodes on the Notary Chain, play a crucial role in validating and securing transactions. Liquidity Providers commit to being counterparties by depositing cryptocurrencies into liquidity pools, enhancing liquidity on the platform.

Operational Logic:

The operational logic of the Portal DEX is distributed across smart contracts executed on both the Notary Chain and the respective Layer 1 (L1) chains hosting the swapped assets. Smart contracts on the Notary Chain oversee Liquidity Pools, while scripts on L1s implement escrow mechanisms, primarily through Hashed TimeLock Contracts (HTLCs).

Escrow Mechanisms (HTLCs):

The escrow mechanisms on L1s employ Hashed TimeLock Contracts (HTLCs), utilizing a hash of a secret generated by the trader. To obtain the counterparty's asset, the trader must disclose the secret within a predefined timelock duration. If either party fails to reclaim the counterparty's asset within the timelock, both parties gain the ability to retrieve their original assets, ensuring fairness and security in the swapping process.

Key Features of ADMM

The Automated Dynamic Market Maker (ADMM) governs all trades on the Portal Network, providing a decentralized protocol for overseeing cross-chain transactions. Some key features of ADMM include:


ADMM's Implementation Similar to Uniswap V3:

ADMM adopts an implementation akin to Uniswap V3, offering comprehensive support for market orders, range orders, and limit orders. This flexibility caters to the diverse needs of traders, providing a versatile trading experience.

Liquidity Providers' (LPs) Flexibility with Range Orders:

LPs on the Portal Network enjoy a high degree of flexibility with range orders. These orders allow LPs to introduce a specified quantity of a particular asset into the corresponding liquidity pool. ADMM, acting as the decentralized overseer, verifies the financial capacity of LPs to meet commitments and updates global data structures accordingly.

Price Range and Tick-Based Liquidity Allocation:

ADMM introduces a novel concept of price range divisions known as ticks. The entire price range, from lower to upper bounds, is divided into these increments. Consider a range order example with 10,000 units of liquidity specified for a price range between 1 and 2. This order is then transformed into multiple limit orders, each positioned at distinct ticks within the range. With a tick spacing of 0.0001, each tick receives an allocated liquidity unit, ensuring an even spread across the entire price range.

Efficient Swap Transactions and Cost Optimization:

Swap transactions on the Notary Chain through ADMM incur lower costs compared to traditional platforms like Uniswap. Leveraging liquidity positions for each trade becomes a feasible and cost-effective strategy, providing traders with a competitive advantage.

Grouped Swap Transactions for Enhanced Security:

To mitigate the risk of swaps being front-run by a participant, ADMM implements a strategy of grouping swap transactions together for processing per block on the Notary Chain. This enhances security and prevents opportunistic front-running, contributing to a fair and secure trading environment.

ADMM Swap Flow



Trader User Flow:

  1. Initiating the Swap Intent:
  • Alice, a trader, initiates the process by creating a swap intent with the DEX Contract Account (DEX CA) on Ethereum.
  • She time-locks her ETH and specifies the swap conditions.

  1. Registration by Validators:
  • Validators play a crucial role in the process of registering Alice's swap intent on the coordination chain.
  • This decentralized validation ensures the integrity and transparency of the swap.

  1. Custom Concentrated Positions by LPs:
  • Liquidity Providers (LPs) have the option to contribute custom concentrated positions to the liquidity pool.
  • These LP-contributed positions enhance liquidity and provide flexibility to LPs.

  1. Matching and Quoted Price:
  • LPs and Alice are matched for the Hashed TimeLock Contract (HTLC) swap based on the quoted price from the coordination chain.
  • This ensures fair and transparent pricing for the trade.

  1. HTLC Creation by LPs:
  • LPs create the second leg of the HTLC by time-locking the BTC, locking in the agreed-upon swap conditions.

  1. Atomic Swap Execution:
  • Alice utilizes the atomic swap secret to withdraw BTC, and in return, LPs receive the locked ETH.
  • The atomic nature of the swap guarantees a secure and trustless exchange.

LP User Flow:

Providing Liquidity and Multisig Creation:

LP Bob aims to earn yield by providing liquidity for PORTAL cross-chain swaps.

He creates a multisig with the validator network, time-locked until the end of the epoch.

Staking and Liquidity Commitment:

LP time-locks BTC and stakes 2% of the total liquidity with validators, enhancing the security and commitment level.

LP commits liquidity positions on the coordination chain for potential swap matches.

Slash Protection Mechanism:

In case an LP backs out of a trade after matching with a trader, a slash mechanism comes into play.

2% of the trade amount from the stake is slashed to discourage untimely withdrawal.

Withdrawal or Continuation:

LPs have the option to withdraw at the end of the epoch or continue into the next epoch.

This flexibility allows LPs to manage their liquidity positions strategically.

Swap Fee Distribution:

LPs receive a portion of the swap fee for each trade, paid in native swapping tokens.

Swap fees for clients are set at 0.3%, with 50% going to the facilitating LP and the remaining 50% distributed among validators through the DEX Contract Account.

Conclusion

In conclusion, Portal's ADMM protocol emerges as a trailblazer in the domain of decentralized cross-chain swaps. By amalgamating the strengths of smart contracts, atomic swaps, efficient liquidity management, and the innovative inclusion of range orders, ADMM offers a secure, cost-effective, and decentralized trading experience. As the cryptocurrency space continues to evolve, Portal's ADMM protocol stands at the forefront, paving the way for a more efficient and secure trading experience across diverse blockchain networks. The protocol not only addresses the challenges associated with cross-chain swaps but also introduces innovative features that enhance the overall liquidity provision and trading dynamics within the decentralized finance ecosystem. As users and developers engage with Portal's ADMM, it is poised to make a lasting impact on the decentralized financial landscape.

Got Questions? We've Got Answers!

Dive into our most frequently asked curiosities and discover more!

1/ What is Portal?
2/ How is Portal's Omnichain Liquidity Layer?
3/ What is the Portal P2P DEX?
4/What is the Portal Atomic Swap Protocol?
5/ What is PortalOS?
6/ What distinguishes Portal from other cross-chain solutions?
7/ What is HyperBitcoinization, and how is Portal contributing to it?
8/ Where can I learn more about Portal's technology and infrastructure?

Dive into the Latest!

Subscribe now and be the first to catch every thrilling update!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
DISCORDTWITTERTELEGRAMMEDIUMLINKEDIN