Smart contract optimization

Optimized smart contracts for profitable swaps.
ABOUT CASE

We developed an optimized smart contract for ENTR, a major player in the DEX aggregator market, which provides users with access to decentralized token exchanges across hundreds of pools on various blockchains.

CHALLENGES
  • Gas Consumption Optimization The more complex the logic of a smart contract, the more gas is consumed during its execution on the network, leading to higher transaction fees for the end user. Our challenge was to investigate ways to streamline and optimize the contract to ensure Entr users benefit from the most cost-effective trades possible.
  • Trade Route Optimization When building trade routes, there is always a trade-off between a complex route—splitting amounts across multiple pools, swapping through several tokens, etc.—and the cost of such a trade. It was crucial for us to strike a balance between obtaining a favorable exchange rate through optimal routing and minimizing the gas cost associated with the trade.
  • Contract Selection and Flow Optimization Entr utilizes different smart contracts for different exchange paths. Our task was complicated by the need to understand the mechanics of these exchanges to a certain level and determine which smart contract was most worth optimizing. This would allow us to route the flow of cost-effective trades through the most suitable contract.
SOLUTIONS
  • Architectural Assessment and Optimization We conducted a thorough assessment of the architecture of Entr's smart contracts and exchanges. Based on our findings, we devised the most optimal architectural solution to streamline the exchange flow, minimizing the cost of trades.
  • Proxy Contract Optimization We focused on optimizing the proxy contract, enabling cost-effective trades with minimal gas usage. This optimization was implemented at the proxy contract level, ensuring that the trades are not only efficient but also gas-light.
RESULTS
  • Effective Cost Reduction Our strategy proved successful as we reduced the cost of trades covering about 80% of all exchanges on the Entr platform.
  • Significant Gas Savings The optimization resulted in gas savings ranging from tens of thousands to hundreds of thousands of gas units. This translates to savings of several tens to several hundreds of percent, depending on the trade route.
CONCLUSION

We successfully optimized the smart contract for Entr, delivering a killer feature that provides them with a significant competitive advantage in the market. This optimization not only enhanced the efficiency of their platform but also ensured a better user experience through lower transaction costs.

Development process

/ 01

PLANNING AND TECHNICAL DETAILS

Meeting with the client to determine exact requirements and desired functional capabilities of the project.

/ 02

ARCHITECTURE DESIGN

Designing the project’s architecture, creating a development and integration plan, and establishing system components and interactions.

/ 03

DEVELOPMENT AND IMPLEMENTATION

Commencing product development, including coding, integrating components, and managing ongoing refinement and feature implementation.

/ 04

TESTING AND REFINEMENT

Performing thorough testing, identifying and resolving issues, and ensuring the product meets all performance and functionality requirements.

/ 05

Release and Support

Managing the product launch, overseeing deployment, and providing post-release support.

Team in project

  • Project manager

    Manages processes, coordinates deadlines, communicates with clients, and gathers requirements.
  • WEB3 BUSINESS ANALYST

    Analyzes business processes and strategies within the Web3 domain, including decentralized applications, mobile devices, and cryptocurrencies.
  • SOLUTION ARCHITECT

    Designs integrated solutions, analyzes business processes, defines system requirements, selects technologies and tools for implementation.
  • SOLIDITY DEVELOPER

    Develops smart contracts, optimizes their performance, and ensures security by identifying vulnerabilities in the code.
  • QA-ENGINEER

    Plans and executes tests, performs both manual and automated testing, creates reports, interacts with developers, and participates in release activities.

Services in case

Same Articles

All Articles

Cases

Smart contract audit
Smart contract audit

Smart contract audit

NDA

A smart contract audit identifies security vulnerabilities and logic flaws in blockchain code, ensuring reliability and user trust.
Bridge Graphite
Bridge Graphite

Bridge Graphite

Crypto exchange for working with Ethereum and Graphite.