Invisible Infrastructure Phase 02 | Dialogue with the OKX Web3 Team: Why Build APIs?
The cryptocurrency industry is driving the construction of APIs, which will enhance technical interoperability and user experience while also promoting the expansion of the ecosystem and the process of decentralization, thereby achieving the large-scale popularization of Web3 technology.
The renowned software architect and technology expert Jim Webber once said, "A good API should be like a clear conversation, not a series of commands." Therefore, APIs are technical interfaces and also a means of communication and dialogue among developers, making clear API design and documentation crucial.
As a leading one-stop Web3 entry point in the industry, OKX Web3 Wallet continues to lead API construction, becoming an indispensable multi-chain Web3 development engine in the industry. By providing a complete set of Web3 development solutions—OnchainOS—it has achieved standardization in the access of chains and services, significantly reducing development cycles and investment costs, thereby connecting global developers for collaborative creation.
In terms of practical applications, the OKX Web3 Wallet API includes major modules such as wallets, DEX aggregators, marketplaces, DeFi, and more, as well as solutions for trading liquidity and on-chain data. This article is the second installment of the "Invisible Infrastructure" series for the OKX Web3 Wallet, and it also serves as the second installment introducing the OKX Web3 Wallet API. It will delve into the stories behind the OKX Web3 team's API construction through a dialogue format.
To learn more about the OKX Web3 Wallet API, you can click to read the first installment: Invisible Infrastructure Issue 01 | Co-creating with Global Developers, A Comprehensive Analysis of the OKX Web3 Wallet API
Driving Forces Behind API Construction
OKX Web3: We were among the first to realize the importance of API construction, which is not only crucial for the development of the OKX Web3 ecosystem but also vital for the industry's growth. After deep contemplation, we began investing in API construction, continuously serving developers and the industry. Upon closer examination, the driving forces behind this are not singular but rather a comprehensive consideration.
From the perspective of wallet APIs, the primary source comes from the needs of industry participants:
First, as the Web3 ecosystem flourishes, more and more people are entering Web3 because it offers businesses better ways and opportunities to attract and serve customers. For example, brands can create immersive brand experiences and interactions through digital assets and NFT collectibles; retailers can customize personalized on-chain incentives and loyalty programs; social service providers can leverage on-chain applications and token distribution in Web3 to establish deeper community connections with creators and users. In summary, Web3 can help businesses establish new business models and generate new revenue streams. An increasing number of people realize that Web3 will create a new industry composed of decentralized applications and services, and they want to enter and master this technology as soon as possible.
Second, many developers and interested institutions face numerous obstacles and difficulties when entering Web3. The primary challenge is the high threshold and complexity of Web3 wallets. Specifically, first, Web3 wallets store users' digital assets and serve as the foundation for facilitating transactions, with a relatively complex underlying system and account structure that are difficult to understand and get started with. Second, the strong isolation between powerful public chain systems makes it very difficult and time-consuming to analyze and apply different public chain systems.
Overall, developing a secure and reliable Web3 wallet system requires a significant amount of time, money, and expertise. Against this backdrop, the OKX Web3 Wallet API service tool emerged to address the aforementioned pain points and issues. Developers can use the OKX Wallet API to efficiently and securely build wallets in just three steps, easily connecting to over 60 networks, including popular EVM and BTC, and supporting cutting-edge ecosystems like inscriptions.
Take the OKX DEX aggregator as an example; it relates to user needs, market competition, and ecosystem development in multiple aspects:
In terms of user needs: With the booming development of decentralized finance (DeFi), users increasingly demand more efficient, secure, and scalable APIs. This is especially true for high-volume traders and developers who wish to implement more flexible trading operations and automated strategy execution through APIs. The OKX DEX aggregator responds to this demand by providing powerful and user-friendly API interfaces to help users meet their diverse needs in decentralized trading.
In terms of market competition: The competition in the DeFi space is exceptionally fierce, with various platforms launching new features and services. To maintain a leading position in the market, the OKX DEX aggregator recognizes that providing powerful and user-friendly APIs is key to staying competitive. Through API construction, the OKX DEX aggregator can quickly iterate and introduce new features to meet market demands and attract more users and developers.
In terms of ecosystem development: APIs are not only tools for functional expansion but also key factors in promoting ecosystem development. Through API construction, OKX DEX can attract more developers to participate, develop more innovative DApps, and thus promote the prosperous development of the entire ecosystem.
For instance, starting from OKX Web3 DeFi, there are more differentiated driving forces:
In terms of developers: APIs can attract more developers to the OKX Web3 platform, enriching the ecosystem. This not only promotes the development and integration of third-party applications but also provides users with more diverse and convenient services.
In terms of user experience: By allowing third-party applications to seamlessly leverage the capabilities provided by the OKX Web3 platform, users can more conveniently engage in trading, asset management, and participate in DeFi activities, thus enhancing the user experience. Additionally, the OKX Web3 DeFi API enhances the platform's interoperability, allowing OKX Web3 DeFi to better interact with other blockchain networks and applications, facilitating cross-chain operations and asset transfers.
In terms of innovation: Another key driving force is the support for innovation. By opening APIs, OKX Web3 DeFi can support and encourage the development of more innovative decentralized applications (dApps) and services, particularly attracting enterprises and developers that require customized solutions, thus maintaining competitiveness in the rapidly changing Web3 field.
In summary, these factors collectively drive the decision for OKX Web3 to engage in API construction, aiming to enhance platform functionality while promoting the growth and sustainable development of the cryptocurrency ecosystem.
Development Process, Challenges, and Innovations
OKX Web3: We can elaborate on the development process, challenges, and innovations from different segments.
First, regarding the development process.
For the OKX Wallet API and OKX Market API, the entire development journey can be described as a process of extracting core functionalities from user demands. Initially, we faced a vast and diverse array of customization requests from users, which were both complex and specific. To meet developers' actual needs, we first abstracted the core requirements from these diverse requests.
This means we needed to extract the most representative features from a wide range of user scenarios and implement them through a limited set of interfaces. The challenge in this process lies in how to simplify and abstract without losing flexibility while still providing sufficient functional coverage. Through this process, we not only successfully developed APIs that meet developers' needs but also introduced innovative thinking into the API design, ensuring that the interfaces remain efficient and concise while still being extensible and versatile.
Second, regarding innovation. From the perspective of the OKX DEX aggregator, the development process underwent several key stages and involved a significant amount of innovation.
1) Modular Design: To ensure the extensibility and flexibility of the API, the OKX DEX aggregator adopted a modular design approach. This design allows the API to easily integrate new functional modules and quickly iterate based on market demands.
2) Multi-chain Support: Supporting 20 networks, including EVM networks and heterogeneous chains like Solana and TRON, to meet the needs of different users. The realization of this multi-chain support requires the API to possess high flexibility and adaptability. The OKX DEX aggregator overcame the differences between various blockchains by designing unified interfaces and compatibility mechanisms.
3) Cross-chain Bridges and DEX Aggregation: Aggregating 18 cross-chain bridges and over 400 decentralized exchanges to ensure users receive better exchange rates and quotes. The realization of this aggregation function requires the API to handle complex transaction routing and price calculations.
4) Single-chain Exchange: Aggregating liquidity from various decentralized exchanges, splitting single transactions across multiple DEXs, and providing users with better prices through efficient routing.
Third, regarding challenges. From the perspective of OKX Web3 DeFi, the main challenges include:
1) Information Volume Challenge: The amount of information returned by the API interface far exceeds that of web content, which is our first challenge. The API needs to meet the diverse needs of different developers, so we must consider both the breadth and depth of information in our design while ensuring performance and response speed under large information volumes. To achieve this goal, we optimized data structures and transmission, ensuring that the API remains efficient when handling large-scale data.
2) Batch Interface Design: Another important design consideration is the batch interface for Open APIs. For example, many developers need to process a large amount of data at once, so we focused on designing batch interfaces. The development of batch interfaces not only improves user efficiency but also helps reduce the load caused by repeated API calls. Through meticulous design and multiple rounds of optimization, we ensured that batch interfaces remain stable and reliable under high concurrency.
3) Integration of Platform-related Information: Each interface not only needs to provide basic market data but also cover more platform-related information. For instance, information about OKX Web3 DeFi's unique features and market conditions needs to be integrated into the API. This increases the complexity of the API, but we believe this information is of significant reference value to users. Therefore, we specifically considered how to efficiently organize and transmit this additional information in our design, ensuring it can be easily accessed and utilized by users.
4) Demand Uncertainty: One of the biggest challenges we faced in the early stages of API development was the uncertainty regarding which functionalities and fields Open API users truly needed. Due to the unclear market and user demands, we needed to experiment boldly in our design. We relied on our understanding of the market and close communication with early users to gradually explore a set of API architectures that could meet diverse needs. At the product design level, this exploratory development process helped us accumulate valuable experience and ultimately form a powerful and flexible API system.
These challenges and innovations not only helped us build a more complete API system but also laid a solid foundation for continuous improvement and optimization in the future.
Achieved Goals
OKX Web3: Goals are not static but dynamically adjusted.**
Currently, the goal of the Wallet API is to continuously keep pace with cutting-edge technologies in the industry, including various advanced technologies for simplifying wallet account systems, such as EIP-4337, and MPC hierarchical wallet solutions favored by institutional users. At the same time, we aim to provide the richest, most comprehensive, and most stable data services, such as asset statistics capabilities for millions of addresses and asset and transaction data for over 100 public chains. In the future, we will continue to deepen our underlying infrastructure, simplify the technical development difficulty, and open-source to make it easier for more people to enter Web3.
The goal of the OKX DEX aggregator API is to become the developer's first choice by providing industry-leading API solutions, becoming the industry standard while promoting the expansion and diversification of the OKX DEX aggregator ecosystem. In the future, we will continuously optimize API functionality and performance, improve user satisfaction and usage rates, and continue to innovate by providing the latest technologies and features to maintain market competitiveness.
The goal of OKX Web3 DeFi is to support more DeFi protocols, provide developers with more functionalities and fields, and continuously optimize performance, such as database upgrades, to accommodate more users and serve the industry well.
The goal of the Market API is to continuously improve API functionality, increase API usage rates, and promote the establishment of industry standards while lowering the entry barriers for the industry.
Key Functionalities Achieved
OKX Web3: This is a very good question; through continuous iteration, we have achieved key functionalities in multiple areas, providing strong technical support for developers.**
Currently, the Wallet API functionality covers multiple core modules, meeting users' basic asset management and trading needs. The key functionalities that have been implemented include:
For example, developers can use the Wallet API for account management, asset management, transaction management, common information queries, and Webhook (real-time subscription to on-chain data), etc. Specifically, developers can use the Wallet API to generate addresses and wallets, query on-chain asset and coin price information, manage transactions, and query other common data such as coin information, gas prices, and address authorization information. The transaction management module provides a rich array of services, including building, signing, broadcasting, tracking transaction history, supporting transactions on EVM and other account model networks, and supporting transactions on UTXO model networks like BTC. With the OKX Wallet API, users can quickly set up a simple asset dashboard in just three steps.
The key functionalities planned for the OKX DEX aggregator API include:
1) Single-chain Exchange: By using efficient routing and smart order-splitting algorithms, along with aggregating liquidity from multiple decentralized exchanges such as Uniswap, Curve, and Balancer, single transactions are split across multiple DEXs, comprehensively calculating prices, slippage, and transaction costs to provide users with better prices.
2) Cross-chain Bridges and Cross-chain Transactions: On one hand, by aggregating high-quality cross-chain bridges like Stargate, Across, Wormhole, and SWFT, we provide multiple cross-chain path options. On the other hand, using our self-developed X Routing algorithm, we automatically find the best liquidity pools during transactions on the source chain and obtain better exchange quantities through smart order-splitting algorithms. Finally, by comparing prices across cross-chain bridges, we comprehensively calculate the outgoing quantity, cross-chain bridge fees, slippage, and transaction costs to obtain the optimal cross-chain quotes.
3) Stability and High Availability: High stability and response speed ensure that the API response time is within 100 milliseconds while providing better inquiry paths for free.
Currently, the OKX Market API plans to launch Runes and Atom APIs in the short term and enrich API functionalities by supporting popular chains or new protocols. Additionally, we plan to introduce push services and a professional trading SDK to enhance trading volume and user numbers.
Furthermore, the current key functionalities planned for the OKX Web3 DeFi API include querying information on all DeFi protocols and investment products, querying users' own holding assets, conducting transactions, redeeming, claiming rewards, and calculating estimated information related to subscriptions and redemptions, etc.
Reducing API Integration Difficulty
OKX Web3: We recognize that the ease of API integration is crucial for widespread adoption among developers, and we have taken a series of targeted measures to ensure that developers can easily and efficiently integrate APIs into their projects.
Taking the OKX Wallet API as an example, we provide:
1) Rich and Comprehensive Technical Documentation and Examples
We have meticulously broken down and organized the technical implementation and content of the Wallet API according to the general steps and content of Web3 application development, striving to provide users with comprehensive and practical capabilities and data. In addition, we also provide quick-start examples for three key application scenarios to demonstrate to developers how to integrate and use the SDK and API calls, enabling them to quickly grasp the key content of API usage.
2) Close and Responsive Technical Support
We have built Discord and TG communities for developers. In the TG community, we have equipped over 5 operational liaison personnel who monitor API feedback 24/7 and respond to technical support. In the Discord community, we have designed dedicated channels for each API module to address corresponding developer inquiries and consultations.
3) Continuously Listening to Technical Community Feedback, Iterating, and Optimizing API Integration Difficulty and Barriers
During the internal testing phase, we set up various 1v1 technical liaison groups for users with clear development needs, accompanying developers to solve various issues and feedback related to integration, and collecting feedback for targeted API optimization.
4) Easy and Simple Developer Workbench
At the same time, we have built a developer workbench for quick access, facilitating project management and API management for users. We will continue to optimize and restructure the developer management platform in the future to become a one-stop development tool.
For the OKX DEX aggregator, we provide:
1) Detailed Documentation: We offer comprehensive and easy-to-understand API documentation covering everything from basic concepts to advanced usage. These documents not only include detailed API call examples but also FAQs and best practice guidance to help developers quickly get started.
2) Developer Tools: To simplify the development process, we provide rich code examples and debugging tools. These tools help developers quickly locate issues and easily integrate API functionalities, reducing development time and costs.
3) Technical Support: Our technical team is always available to assist developers. Whether it’s issues with API usage or integration, our technical support team can respond promptly to ensure a smooth integration experience for developers.
For the OKX Market API, we provide:
1) Detailed Documentation: We have written comprehensive API documentation covering all functional modules of the API, providing rich usage cases and code examples. These documents are well-organized, allowing developers to easily access all necessary resources and conduct API testing and debugging instantly, reducing the learning and development curve.
2) Interface Optimization: In API design, we focus on optimizing the usability of interfaces, ensuring that the API call logic is simple and clear. Through streamlined parameter design and consistent response formats, developers can more easily understand and use API functionalities.
3) SDK Provision: We provide dedicated SDKs for mainstream programming languages and frameworks, allowing developers to quickly integrate the OKX Market API without having to write code from scratch. The SDK not only simplifies the calling process but also includes many common functionalities and error handling mechanisms, further reducing integration difficulty.
For the OKX Web3 DeFi, we provide:
1) We invest significant resources to improve API documentation, covering not only the technical details of the API but also usage cases and FAQs. To further reduce developers' learning costs, we provide rich example codes and practical use cases. These examples directly showcase common usage scenarios of the API, enabling developers to quickly understand and apply them to their projects. The documentation is structured clearly and hierarchically, aimed at helping developers quickly grasp and master API usage.
2) Timely Communication with Project Parties: We emphasize timely communication with project parties, maintaining efficient interaction during the API integration process. This direct communication channel allows developers to quickly obtain help and resolve issues encountered during integration, ensuring smooth project progress.
Training courses to help developers better understand the functionalities and best practices of the API.
These measures aim to provide developers with a seamless and efficient integration experience, ensuring they can fully leverage the capabilities of the OKX Web3 API to succeed in decentralized applications.
Target Audience and Application Scenarios
OKX Web3:
First, the capabilities of the OKX Wallet API can serve exchange-level users with millions of addresses, providing asset statistics and trading capabilities for millions of addresses. At the same time, it can also serve a wide range of Web3 application developers, allowing them to access the most comprehensive coin and public chain data and build their own user systems for easy asset management and trading construction.
Second, the OKX DEX API primarily serves developers creating decentralized applications (dApps) and tools, professional traders conducting large and high-frequency trades, as well as financial institutions and large enterprise users. It is applicable to major scenarios such as decentralized trading and cross-chain trading, for example, performing various decentralized trading operations through the API to ensure better prices and lower slippage; or achieving asset conversion between different chains through the API to ensure efficiency and security in cross-chain trading.
Third, the OKX Market API mainly serves aggregators, bots, GameFi projects, and primary market project parties, covering multiple aspects such as trading market creation, batch trading, and market data acquisition.
Fourth, the OKX Web3 DeFi API primarily targets developers and project parties needing to integrate DeFi protocols and trading products.
User Feedback
OKX Web3: The usage rate and user feedback for the OKX Web3 API have generally been outstanding, specifically reflected in the following aspects:
In terms of usage rate, since its release, the usage rate of the OKX API has steadily increased, attracting more developers with its high performance, rich functionalities, and stability.
In terms of user feedback, users have responded positively, generally finding the documentation detailed and easy to understand, with a relatively simple integration process. Many users have particularly pointed out that the API performs excellently in handling complex trading scenarios and large data volumes, significantly improving their work efficiency. Additionally, some users have provided constructive improvement suggestions, such as optimizing the performance of certain interfaces or adding specific functionalities. We highly value this feedback and have incorporated these suggestions into our subsequent development plans to further enhance the user experience and functionality of the API.
In the future, we will continue to listen to users' voices, continuously optimize API functionalities, and ensure that we meet the ever-changing needs of the market and users, bringing value to more users.
Upgrade and Maintenance Strategy
OKX Web3: The construction of the OKX Web3 API adopts multi-layered and multi-faceted measures to respond to changes in market demand, as well as upgrade and maintenance strategies, ensuring that the API can continuously meet user needs while maintaining technological leadership and market adaptability.
In terms of responding to changes in market demand:
1) Regular Surveys: We regularly conduct user surveys and market analyses to gain in-depth insights into users' actual needs and the latest trends in industry development. These surveys help us capture market dynamics in a timely manner, ensuring that the functionality design of the API remains aligned with user needs, promoting continuous optimization of the API in terms of functionality and services.
2) Flexible Iteration: We adopt agile development methods to quickly iterate based on changes in market demand. Through short-cycle development and testing processes, we rapidly introduce new features and improvements, enabling the API to adapt promptly to market changes and maintain its competitiveness. This flexible iteration approach ensures that we can swiftly respond to user needs and launch new features and enhancements that meet market expectations.
3) Industry Trend Tracking: In addition to user surveys, we closely monitor industry trends, particularly new technologies and standards in the blockchain and decentralized finance (DeFi) fields. By tracking and analyzing these trends, we can proactively position ourselves to ensure that the API supports the latest technological standards and market demands.
In terms of upgrade and maintenance strategies:
1) Continuous Optimization: We regularly perform performance optimizations and security checks on the OKX Web3 API to ensure that it remains efficient and secure. By optimizing code, improving architecture, and enhancing server performance, we can increase the API's response speed while reducing potential security risks.
2) User Feedback: We place great importance on user feedback and collect and address this feedback promptly through various channels. Whether it’s functional suggestions or issue reports, we respond quickly to fix problems and improve functionalities. Users' opinions are a crucial basis for our continuous enhancement of the API, ensuring that we can swiftly adjust and optimize the API to meet users' actual needs.
3) Version Management: To ensure the compatibility and stability of the API, we adopt a strict version management strategy. Before releasing new versions, we conduct comprehensive testing and validation to ensure that the introduction of new features does not affect the stability of existing functionalities. Through clear version management, we can also provide users with backward-compatible upgrade paths, ensuring they do not encounter compatibility issues when using new versions.
4) Regularly Launching New Features: To maintain technological leadership, we regularly introduce new features and updates. These updates include not only functionalities requested by users but also innovative features developed independently by us. By continuously introducing new characteristics, we ensure that the OKX Web3 API remains at the forefront of the market, providing users with advanced technical support.
Through these responsive measures and upgrade maintenance strategies, the OKX Web3 API can flexibly adapt to changes in market demand, continuously providing efficient, stable, and secure services. We will continue to be user-demand-oriented, continuously enhancing the API's functionalities and performance to ensure it remains a leader in the rapidly changing market environment.
Construction Planning
OKX Web3:
The construction planning for the OKX Wallet API includes: (1) Providing more real-time, convenient, and comprehensive asset and transaction data. We have already optimized data sources and acquisition methods to ensure that we meet the developers' ongoing expansion needs. (2) Continuously integrating popular public chains, simplifying the entry barriers for accessing popular public chains, and enriching the diverse wallet ecosystem together. (3) Gradually providing capabilities and solutions for MPC wallets and AA smart wallet accounts, offering powerful wallet services with diverse scenarios through open-source, simplifying the onboarding process for Web3 wallets.
The construction planning for the OKX DEX API includes the following aspects: adding more single-chain exchange and cross-chain trading functionalities to enhance the comprehensiveness of the API; continuously optimizing API performance to improve response speed and stability; enhancing developer support by providing more documentation and tools; and promoting the API through various channels to attract more users and developers.
The OKX Web3 DeFi API will continue to follow user needs, such as historical data on protocol APY, and undergo continuous iterations.
The planning for the OKX Market API in the coming months includes supporting new BTC protocols, building push services, improving aggregation interface functionalities, launching trading SDKs, and supporting more heterogeneous network APIs. We plan to open more API interfaces in the future, especially targeting new networks and protocols, continuing to expand the API's functionalities and application scenarios to meet market and user demands.
Disclaimer
This article is for reference only. It represents the author's views and does not reflect the position of OKX. This article does not intend to provide (i) investment advice or recommendations; (ii) offers or solicitations to buy, sell, or hold digital assets; (iii) financial, accounting, legal, or tax advice. We do not guarantee the accuracy, completeness, or usefulness of such information. Holding digital assets (including stablecoins and NFTs) involves high risks and may fluctuate significantly. You should carefully consider whether trading or holding digital assets is suitable for you based on your financial situation. Please consult your legal/tax/investment professionals regarding your specific circumstances. You are responsible for understanding and complying with applicable local laws and regulations.