KyberSwap: Powering the future of decentralized crypto exchange with cloud technology
About Kyber Network
Kyber Network runs KyberSwap, a multi-chain decentralized exchange and aggregator enabling users to swap and earn at the best rates. Founded in 2017, the platform has a vision to become the liquidity hub for the decentralized economy, building protocols that support convenient and secure value exchange in DeFi, NFT markets, and beyond. Its Decentralized Exchange (DEX) aggregator, KyberSwap.com, powers 100+ integrated projects and has facilitated over US$11 billion worth of transactions for thousands of users.
Tell us your challenge. We're here to help.
Contact usAbout Searce
Searce is one of the largest Google Cloud partners globally with over 12 years of experience, 150+ Google Cloud certifications and 300+ Google Cloud Experts in-house. It works with digital native companies and enterprises to re-imagine and future proof their business.
Kyber Network moved to a transformative Kubernetes-based Google Cloud architecture, achieved 100% improvement in crypto trading latency, and developed an innovative AI market intelligence solution with Google Cloud.
Google Cloud results
- Supports competitive, real-time crypto exchange by reducing trading latency from 2 seconds to under 1 second
- Liberates team to focus on creative solutions by slashing infrastructure provisioning time from 1 hour to 1 minute
- Builds crypto community trust by eliminating platform outages during traffic spikes
- Enhances trading competitiveness by enabling super-fast market rates with MemoryStore for Redis data caching
Achieves 99.99% platform uptime with GKE
The growth of crypto has spawned a dramatic proliferation of tokens, with more than 20,000 available worldwide for trading on more than 500 exchanges. While that opens a world of opportunity, it also creates a bewilderingly diverse pool of value for traders, token creators and platform developers alike.
Normally, crypto players rely on a crypto exchange to swap tokens, depositing funds with the platform and getting a rate that can differ significantly from other exchanges. Loi Luu and Victor Tran, two university friends from Vietnam, dreamed of creating a decentralized liquidity hub that enables people to freely swap tokens without depending on a centralized intermediary such as an exchange.
In 2017, they launched Kyber Network in Singapore. Its flagship Decentralized Exchange (DEX) aggregator, KyberSwap, automatically finds the best rate available, while maintaining privacy and custody of their assets. Traders, liquidity providers and platform developers, such as gaming startups, all benefit from a one-stop shop that optimizes swapping from any of the more than 20,000 tokens in existence on 12 chains, including Ethereum, BNB Chain, Polygon and more. In line with its vision to make Decentralized Finances (DeFi) easy, accessible and safe for all, KyberSwap also enables users to earn as liquidity providers, and provides free pro-trading tools and other advanced technologies.
Kyber Network began life on one of the major public cloud providers, deploying virtual machines (VMs) to drive crypto exchange between global players. In 2020, it was onboarded to the Google Cloud for Startups program. As the platform gained in popularity, the startup soon found itself struggling to provision VMs fast enough to handle sudden surges in trading volume.
"Since Google invented Kubernetes, we found that GKE simply offers the best Kubernetes service in the world. By leveraging the power of GKE, we gained the nimble auto-scaling we needed to meet any dizzying surge in crypto demand, while freeing the team to develop solutions instead of spinning up VMs."
—Tu Nguyen, Head of Engineering, Kyber NetworkThe team decided it needed to move to a Kubernetes-based architecture, for the unlimited auto-scaling enabled by containerized microservices. Working with its partner Searce, Kyber Network embarked on a full-scale infrastructure migration to Google Cloud, attracted by the benefits it felt confident of gaining by building its architecture on Google Kubernetes Engine (GKE).
"Since Google invented Kubernetes, we found that GKE simply offers the best Kubernetes service in the world," says Tu Nguyen, Head of Engineering, Kyber Network. "By leveraging the power of GKE, we gained the nimble auto-scaling we needed to meet any dizzying surge in crypto demand, while freeing the team to develop solutions instead of spinning up VMs."
Powering unlimited, real-time crypto trading with Google Kubernetes Engine
Today, Kyber Network runs 13 Kubernetes clusters across three environments of production, testing and development, delivering up to 100 services to enable a total trading volume of more than $10 billion. Since migrating to Google Cloud in 2021, Kyber Network has welcomed more than 1 million new users, easily absorbing the scaling demands generated by the rapid expansion.
According to Nguyen, such impressive results are driven by significant operational gains since GKE adoption. In Kyber Network's original environment built around VMs, trading latency was roughly two seconds, and the platform sometimes faced downtimes of up to two minutes whenever it encountered an unexpected spike. With GKE, trading latency has been reduced to less than one second, and the platform has not experienced a single point of failure. Nguyen says KyberSwap is on track for 99.99% uptime by the end of 2022.
Some of the biggest gains have been in team empowerment. Previously, whenever a Kyber Network partner, such as a gaming platform, ran a campaign that could be anticipated to attract high usage, the DevOps team needed to scale VMs in advance to prepare for the surge. That required Kyber Network engineers to spend one hour or more on VM provisioning, then more time scaling down after the wave had passed. On GKE, the team needs only a minute to deploy Kubernetes clusters for any new service. Even better, cluster nodes can be saved as container images that can be subsequently executed with no further preparation.
"Since the move to GKE, our engineering team is happier than it has ever been, because they can concentrate on writing code rather than operating infrastructure," says Nguyen. "On our legacy provider, they wasted time setting up, installing and deploying VMs. Now, they can focus on creating their own API gateway solutions, without dealing with day-to-day chores." He goes on to add that the success of the migration process was made even easier with the support of the Google Cloud team, who were always on hand to help when the team had any questions, making the transition really smooth.
"I felt like we had a really reliable and secure team working with us, which is very important," says Nguyen.
Enabling instant, competitive market rates with Memorystore for Redis
Another powerful driver of Kyber Network's Google Cloud architecture is MemoryStore for Redis. It is a fully-managed service for Redis that reduces latency with scalable, secure, and highly available in-memory data storage applications, while requiring zero management of complex Redis deployments.
Kyber Network's success hinges on providing the optimal trading route for users from thousands of different options. This requires real-time caching of current and historic pricing and other information from tokens, which then can be instantly retrieved to drive through the platform's artificial intelligence (AI) algorithms.
"A critical aspect of our solution is retrieving instantly-updated market rates, because whenever somebody in the world makes a swap the token price will change. Memorystore for Redis provides us super-fast data-retrieval latency that enables us to launch our AI algorithms to calculate the best trading route for users."
—Tu Nguyen, Head of Engineering, Kyber NetworkBy enabling automated caching of price points and other token information in the Redis key-value data store, Memorystore for Redis gives Kyber Network a powerful tool to achieve competitive trading speed with real-time market rates. It also saves the DevOps team from the headache of deploying open-source Redis clusters.
"A critical aspect of our solution is retrieving instantly-updated market rates, because whenever somebody in the world makes a swap, the token price will change," says Nguyen. "Memorystore for Redis provides us super-fast data-retrieval latency that enables us to launch our AI algorithms to calculate the best trading route for users."
Empowering traders with market intelligence through BigQuery data analytics
Kyber Network has now embarked on the next stage of its mission to transform crypto trading, with a new product feature called TrueSight that empowers users by applying AI to anticipate trending tokens on KyberSwap.
With TrueSight, Kyber Network users can obtain real-time market intelligence from an AI engine that analyzes the staggering volume of data that courses through the KyberSwap exchange aggregator. To drive this mission, Kyber Network is relying on BigQuery as the powerful, scalable data warehouse it needs to crunch unlimited amounts of crypto data, for instant AI insight into pricing trends.
"Now that we've optimized our architecture on GKE, we feel there's no limit to the innovations we can achieve by driving market intelligence with BigQuery to maximize customer value."
—Tu Nguyen, Head of Engineering, Kyber NetworkAnother future project for Kyber Network is working with partner Searce on deployment of Cloud Armor for cost-effective, enterprise-grade security to protect against denial of service and web attacks. Nguyen says he has been impressed by the proactive support and training the team has received from Searce on Cloud Armor deployment, as well as optimization of Google Cloud Committed Use Discount (CUDs).
"In driving these strategies, Searce is really helping us with critical security and infrastructure needs through deep insight and proactive training," says Nguyen. "Now that we've optimized our architecture on GKE, we feel there's no limit to the innovations we can achieve by driving market intelligence with BigQuery to maximize customer value."
Tell us your challenge. We're here to help.
Contact usAbout Kyber Network
Kyber Network runs KyberSwap, a multi-chain decentralized exchange and aggregator enabling users to swap and earn at the best rates. Founded in 2017, the platform has a vision to become the liquidity hub for the decentralized economy, building protocols that support convenient and secure value exchange in DeFi, NFT markets, and beyond. Its Decentralized Exchange (DEX) aggregator, KyberSwap.com, powers 100+ integrated projects and has facilitated over US$11 billion worth of transactions for thousands of users.
About Searce
Searce is one of the largest Google Cloud partners globally with over 12 years of experience, 150+ Google Cloud certifications and 300+ Google Cloud Experts in-house. It works with digital native companies and enterprises to re-imagine and future proof their business.