(03) Developing TONDEX utilizing Uniswap

Eugene Cho
Tokamak Network
Published in
11 min readDec 6, 2023

Article series : Developing DEX on the Tokamak Network’s Titan

This is the second in a series of three articles about developing a DEX on Tokamak Network’s Titan network.
(01) TONDEX, Orderbook style DEX using Uniswap V4
(02) Exploring new services of DEX with Uniswap v4 key features
(03) Developing TONDEX utilizing Uniswap (this article)

TL;DR

  1. TONDEX, a decentralized exchange service, is targeted for development in the first half of next year, with a user-friendly UX/UI similar to centralized exchanges and core features such as limit trading and ‘Permit Swap’.
  2. By utilizing the features of Uniswap V4, TONDEX could be developed to expand its services in a variety of ways. So, it is welcomed for communities and developers within the Tokamak Network ecosystem to develop it themselves via the Tokamak Network Foundation’s grant program.

Introduction

TONDEX (tentative name) is a DEX being developed on the Tokamak Network with the goal of opening in the first half of next year by utilizing the advantages of such limit trading functionality of Uniswap V4. In particular, its UX is similar to that of a centralized exchange, and we aim to make it easy for beginners to use. Currently, the basic work on UX/UI has been completed, and full-scale development will be carried out next year, reflecting the upgrade of V4. In this article, we’d like to introduce you to these developments direction in detail

TONDEX core features

This section introduces the core functions provided by TONDEX. However, it should be noted that this is proposed in this planning stage, so it may change in the development stage depending on the actual demand of customers and market conditions.

First, TONDEX supports limit trading. We also intend to support ‘Permit Swap’ function. To give an example of this feature, let’s say you want to purchase ETH with TON, especially when the price of ETH is expected to fall further, you can place a limit order for more ETH by first swapping the ETH you already own with TON in advance.

<TONDEX 주문창 UX/UI>

Second, TONDEX pursues an easy-to-use UX/UI like a centralized exchange. The reason why we neglected the UX/UI of traditional DEXs and adopted a concept similar to the UX/UI of centralized exchanges is that the order book is its good structure for observing real-time liquidity changes.

Uniswap V4 enables the limit order which means that a wide range of liquidity changes can occur due to the addition of liquidity generated by customers’ trading behavior in real-time, not just the liquidity set in advance by the existing AMM. Therefore, the UX/UI should also change to make it easier to observe these wide liquidity changes.

<중앙화 거래소처럼 친숙한 UX/UI>

Third, we will provide a cumulative return management function that is shown when users connect their cryptocurrency wallets. The background is that a DEX will be transformed from a simple swap function into a full-fledged investment trading platform utilizing Uniswap V4. Therefore, it will be necessary to present a user’s performance of investment transactions by period.

In order to provide low fees and fast transaction processing, TONDEX will be serviced on the Titan Network, and the data on the blockchain will be fetched and calculated in real time to provide periodic return information for users. This will take some processing time, but will eliminate the burden of developing a separate dedicated server.

Fourth, it will be helpful for the mutual development of both services if we create a page to introduce promising projects that have been launched or are preparing to be launched on TONStarter, and link to TONStarter to encourage a TONDEX user to participate in the process of listing on TONDEX. In particular, for a project to be successfully launched, it needs to be actively marketed. In the case of Binance Launchpad and Polkastarter, for example, the platform itself leads this marketing both online and offline, making it easy and fruitful.

However, if DEXs are to be truly disintermediated, they will need to move away from centralized, platform-driven marketing and toward more decentralized services that allow projects to market directly to their communities.

On the other hand, it would be a good alternative to create a page such as “Runway” on the TONStarte website, which scores the project team’s social media promotion, team building, Github repository updates, and community sharing of the page in the pre-launch phase, and automatically updates it continuously. This will allow the project team to take control of their own online marketing with minimal time and effort.

<Polkastarter‘s centralized marketing>

TONDEX with DeFi

With the advent of Uniswap V4, it’s worth exploring other possibility that are technically feasible to implement on TONDEX at some point in the future, if not now. This is because various actors in the Tokamak Network ecosystem can provide ideas for the development of various services using TONDEX.

For example, asset-backed securitization products are expected to be activated in Defi. While the trend in the past has been to fix assets such as staking or bonding, in the future, we may see a shift towards maximizing investment efficiency through securitization.

The market is already seeing the emergence of Defi in the field of asset securitization, such as ‘Pendle’, which separates interest and profit. In addition, for more advanced asset-backed products to emerge, limit order is going to play a key role. This is because a user needs to sell at the desired price to achieve the wanted target yield.

For reference, Pendle has made it possible to separate the principal and interest from staking by using wrap contracts for DAI, ETH, etc. staked in staking services such as Compound and Lido. As a result, only YT (Yield Token), which corresponds to the interest part, can be traded separately on AMM (Automated Market Maker).This is the first DeFi protocol to allow trading of YT.

Rather than creating a separate liquidity pool for the interest portion of the YT, Pendle utilizes a flash swap function to convert it to the principal token for trading. Using Uniswap V4’s singleton contract, even if the exchange process becomes more complex, it can be handled with low gas costs. This means that more complex derivatives composed of various tokens will be available in the future.

TONDEX with TONStarter

Similarly, TONStarter would like to leverage Uniswap V4 features to explore additional cases that may one day be technically feasible.

For example, technically TONStarter will be able to launch not only blockchain projects, but also fund products for investment risk diversification on TONStarter.
In other words, the fund itself could be implemented with Uniswap V4, launched on TONStarter, and invested in various blockchain projects with the funds raised.

Since the tokens will be traded on a DEX, each investor will be able to trade quickly at any time, with each investor benefiting from price differentials immediately after listing.

The value of indirect fund tokens can be liquidated at any time with project tokens through a singleton contract, so that the implied value of indirect tokens can be secured, i.e., the legitimacy of the transaction price can be secured.

However, since a liquidity pool of project tokens must exist at the time of contract distribution of indirect fund tokens, it seems that it can be used for diversified investment in projects that have already been launched. Or, if multiple projects are launched at the same time, the fund itself that invests in such a project can be launched together with the project.

This would be a great way to diversify risk for investors.
In addition, if the number of stocks increases sufficiently, decentralized EFTs will become possible, and if the emergence of ETFs can minimize investment risk, it will serve as a factor to accelerate the popularization of DeFi.

Conclusion

In the three articles so far, the new features of Uniswap V4 and the direction of TONDEX’s various services utilizing them have been discussed. Tokamak Network intends to develop and open-source core functionality as early as the first half of next year. This means that the actual services can be developed by the community members, and Tokamak Network will focus its efforts on developing the underlying technology required for them.

Furthermore, the development of TONDEX core functionality itself can be driven by developers or communities within the Tokamak Network ecosystem.

Refering this series of three articles, If you would like to provide a more concrete direction for development, or if you would like to lead the development yourself starting next year, you can apply for a grant from the Tokamak Network Foundation in December to receive funding and develop your own project.

References

What is Pendle? Enabling Tokenizing and Trading Yield in DeFi

Pendle docs

Korean Version

Article series : Developing DEX on the Tokamak Network’s Titan

이 글은 Tokamak Network의 Titan 네트워크 상에서 DEX를 개발하는 것을 주제로 하는 3편의 시리즈 중에서 세번째입니다.

(01) TONDEX, Orderbook style DEX using Uniswap V4
(02) Exploring new services of DEX with Uniswap v4 key features
(03) Developing TONDEX utilizing Uniswap (this article)

TL;DR

  1. 탈중앙화 거래소 서비스인 TONDEX는 내년 상반기에 개발을 목표로 하고 있이며, 중앙화 거래소와 유사한 사용자 친화적인 UX/UI와 지정가거래 및 ‘Permit Swap’과 같은 핵심 기능이 기획되었다.
  2. Uniswap V4의 기능을 다각도로 활용하면 TONDEX의 다양한 서비스 확장이 가능한데, 이러한 개발과정에 있어서 Tokamak Network 재단의 grant 제도 등을 활용한다면 Tokamak Network 생태계에 속한 커뮤니티 혹은 개발자들이 직접 개발하는 것도 적극 권장할만하다.

Introduction

TONDEX(가칭)는 토카막네트워크에서 이러한 지정가거래의 장점을 살려서 내년 상반기 오픈을 목표로 개발중인 DEX다. 특히 화면 UX는 중앙화된 거래소의 UX와 유사하도록하여, 초보자들도 손쉽게 사용하는 것에 목표를 두고 있다. 현재 UX/UI에 대한 기초작업은 완료하였으며, 이번 V4의 업그레이드를 반영하여 내년도에 본격적인 개발이 이뤄질 예정이다. 본 글에서는 이러한 개발방향에 대하여 상세히 소개하고자 한다

TONDEX 핵심기능

TONDEX에서 기본적으로 제공하는 핵심기능에 대하여 소개하고자 한다. 다만 이는 개발 기획단계에서 제안된 것이므로, 추후 고객의 실제 수요와 시장상황 변화에 따라 개발단계에서는 달라질 수 있음을 먼저 밝힌다.

첫째, TONDEX는 지정가매매를 지원한다. 또한 permit swap 기능도 지원하고자 한다. 이 기능에 대해 예를 들어 설명하자면 TON으로 ETH를 구매할 경우, ETH의 추가 하락이 예상될 때, 이미 보유하고 있는 ETH도 TON으로 swap을 먼저 하도록 함으로써, 이로 인해 더 많은 ETH를 지정가 매매로 주문을 넣을 수 있다.

<TONDEX 주문창 UX/UI>

둘째, TONDEX는 중앙화된 거래소처럼 보기 쉬운 UX/UI를 추구한다. 종전의 DEX가 보여준 UX/UI를 버리고 중앙화된 거래소의 UX/UI와 유사한 컨셉을 채용한 이유는 호가창에서 실시간 유동성 변화를 관찰하기에 좋은 구조이기 때문이다. Uniswap V4의 등장으로 지정가매매가 가능해졌으며, 이는 기존의 AMM에서 사전에 설정해놓은 유동성뿐만 아니라 실시간으로 고객의 매매행위로 인해 발생하는 유동성이 추가되어 폭넓은 유동성의 변화가 일어날 수 있음을 의미한다. 따라서 UX/UI도 이러한 유동성 변화를 손쉽게 관찰하기 좋은 형태로 바뀌어야 한다.

<중앙화 거래소처럼 친숙한 UX/UI>

셋째, 암호화폐 지갑 연결 시 제공되는 누적수익률관리 기능을 제공하고자 한다. DEX는 종전의 단순한 swap 기능에서 탈피하여 Uniswap V4를 활용한 본격적인 투자거래 플랫폼으로 탈바꿈할 전망이다. 따라서 투자거래의 성과를 기간별로 제시할 수 있는 기능이 필요할 것이다.

저렴한 수수료 제공과 빠른 거래처리를 위해 TONDEX는 Titan Network에서 서비스 될 것이며, 고객이 거래한 물량에 대하여 기간별 수익률 정보를 제공하고자 블록체인 상의 자료를 실시간으로 가져와서 연산하여 제공하게 된다. 따라서 처리시간은 다소 걸리지만 별도의 전용 서버개발에 대한 부담은 사라지게 된다.

넷째, TONStarter에서 런칭되는, 혹은 런칭 준비중인 유망 프로젝트를 소개하는 페이지를 신설하고, TONStarter로 이동하여 TONDEX에 상장하는 과정에 참여할 수 있도록 연계하면 두 서비스의 상호 발전에 도움이 될 것이다. 특히 프로젝트가 성공적으로 런칭되려면 마케팅 활동을 활발히 해야 한다. 일례로 Binance Launchpad나 Polkastarter의 경우는 플랫폼 자체가 이러한 마케팅을 온라인 및 오프라인으로 모두 리딩해주기 때문에 간편하고 성과도 좋은 편이다. 하지만 DEX가 진정으로 중간매개자 없이 진행되려면 마케팅도 플랫폼이 리딩하는 중앙화된 마케팅을 지양하고, 프로젝트가 커뮤니티를 대상으로 직접 마케팅을 실시할 수 있도록 탈중앙화 기반의 서비스를 강화해야 할 것이다.

한편 TONStarte 웹페이지에서도 ‘Runway(가칭)’와 같은 페이지를 신설하여, 런칭이전 단계에서 프로젝트 팀의 소셜미디어 홍보, 팀빌딩, Github repository 업데이트, 커뮤니티의 해당 페이지 공유 등을 모두 점수화 하여 지속적으로 자동 업데이트하는 것도 좋은 대안이 될 것이다. 이로 인해 프로젝트팀은 최소한의 시간과 노력으로 스스로 온라인 마케팅을 주도할 수 있게 된다.

<Polkastarter의 중앙화된 마케팅 프로세스>

DeFi와 연계한 TONDEX

Uniswap V4의 출현으로 인해 지금 당장은 아니지만, TONDEX에서 언젠가는 기술적으로 구현이 가능한 추가 사례를 살펴보는 것도 의미가 있을 것이다. Tokamak Network 생태계내의 다양한 주체들이 TONDEX를 활용한 다양한 서비스를 개발할 수 있도록 아이디어를 제공해 줄 수 있기 때문이다.

예를 들어, Defi에서도 자산유동화 상품의 활성화가 기대된다. 종전에는 스테이킹이나 본딩과 같은 자산을 고정시키는 것이 트렌드였다면 향후에는 유동화를 통해 투자효율을 극대화하는 쪽으로 방향을 바꿔볼 수도 있을 것이다. 이미 시장에는 이자와 수익을 분리해서 판매하는 pendle과 같은 자산유동화 분야의 Defi가 출현하고 있는 중이다. 아울러 좀더 고도화된 자산유동화 상품이 출현하려면 지정가매매가 원활히 이뤄져야할 것이다. 원하는 가격에 판매를 해야 목표수익률을 달성할 수 있기 때문이다.

참고로 Pendle은 Compound나 Lido와 같은 스테이킹 서비스에서 스테이킹 해놓은 DAI, ETH 등을 wrap 컨트랙트를 이용하여 원금과 스테이킹으로 인한 이자를 분리할 수 있게 만들었다. 이로 인해 이자부분에 해당하는 YT(Yield Token)만 별도로 AMM(Automated Market Maker)에서 거래를 할 수 있게 서비스하는 중이다. 이는 시스템에서 토큰화된 미래 수익률의 거래를 허용하는 최초의 다파이(DeFi) 프로토콜이라 할 수 있다.

Pendle에서는 이자부분에 해당하는 YT에 대한 별도의 유동성 풀을 만들지 않고 flash swap기능을 활용하여 원금토큰(Pricipal Token)으로 환전하여 거래하도록 하고 있다. Uniswap V4의 싱글톤 컨트랙트를 이용하면 이러한 환전과정이 더욱 복잡해지더라도 저렴한 가스비로도 대응이 가능하다. 즉, 향후에는 다양한 토큰들로 구성된 더욱 복잡한 파생상품도 서비스가 가능할 전망이다.

TONStarter와 연계한 TONDEX

마찬가지로 TONStarter에서도 Uniswap V4 기능을 활용하여 언젠가는 기술적으로 구현이 가능한 추가 사례를 살펴보고자 한다. 예를 들어 TONStarter에서는 블록체인 프로젝트뿐만 아니라 투자리스크 분산을 위한 펀드상품도 TONStarter에서 런칭하도록 구현해 볼 수 있을 것이다.

즉, 간접투자펀드 자체를 Uniswap V4로 구현하고 TONStarter에 론칭하고, 여기서 조달된 자금으로 다양한 블록체인 프로젝트에 투자하는 것이다. 간접투자펀드 토큰이 DEX에서 거래되므로 각 투자자 개인은 상장직후부터 시세차익을 기대할 수 있는 등 언제라도 신속한 거래가 가능한 것이 장점이다.

간접펀드토큰의 가치는 싱글톤 컨트랙트에 의하여 투자대상프로젝트 토큰으로 언제든지 청산가능하도록 하여, 이를 통해 간접토큰의 내제가치를 확보할 수 있게 된다. 즉, 거래가격의 정당성을 확보할 수 있을 것이다.

다만, 간접펀트토큰의 컨트랙트 배포시에 투자대상 프로젝트 토큰의 유동성풀이 존재해야 하므로, 이미 런칭된 프로젝트에 분산투자하는 용도로 사용가능할듯 하다. 혹은 복수의 프로젝트가 동시에 런칭하는 경우라면 묶어서 해당 프로젝트에 투자하는 펀드자체도 프로젝트와 함께 런칭할 수 있을 것이다. 이렇게 하면 투자자 입장에서 위험분산 효과가 크다.

또한 종목의 숫자를 충분히 늘리면 EFT가 가능해지는데, ETF의 등장으로 투자리스크를 최소화할 수 있다면 DeFi의 대중화를 앞당기는 요소로 작용할 것이다.

결론

지금까지 세 편의 아티클을 통해 Uniswap V4의 새로운 기능과, 이를 활용한 TONDEX의 다양한 서비스 방향을 제시하여 보았다. Tokamak Network는 빠르면 내년 상반기에 핵심 기능위주로 개발하여 오픈소스로 공개하고자 한다. 즉, 실제 서비스는 커뮤니티에서 할 수 있도록 길을 열어주는 것이며, 그에 필요한 기반기술 개발에 Tokamak Network의 역량을 집중하는 것이다.

더 나아가서, 이러한 기반기술 개발 그 자체도 Tokamak Network 생태계 내의 개발자 혹은 커뮤니티가 직접 주도할 수도 있다. 본 아티클 시리즈를 참고하여 좀더 구체적인 개발방향을 제시하고, 내년부터 직접 개발을 리딩하고 싶다면 12월 중으로 Tokamak Network 재단에 grant를 신청하여 자금지원을 받고 직접 개발할 수 있을 것이다.

참고자료

What is Pendle? Enabling Tokenizing and Trading Yield in DeFi

Pendle docs

--

--