How Safe Is DeFi? An Auditor’s View on Audits, Security and 1inch Aqua

October 1, 2026
•
10
min of reading

Is DeFi safe? A smart contract audit answers part of that question, but not all of it. An audit provides assurance about the code reviewed; security also depends on economic design, governance, infrastructure and the organisation operating the protocol.

After BailSec audited 1inch Aqua, 1inch invited Vik from our team to discuss audit limitations and the security implications of Aqua's shared-liquidity design. This article draws on that interview with 1inch to explain what we assess, where an audit's assurance ends and how users and partners should interpret the results.

DeFi Risks Beyond Smart Contract Bugs

Many of the risks we assess extend beyond obvious code bugs. Five areas deserve particular attention.

The ecosystem. A protocol depends on the environment in which it runs. Flash-loan liquidity manipulation, variations in common token standards and potential breaks caused by future Ethereum Virtual Machine (EVM) hard forks can all affect its security.

Composability. The ability to combine protocols is a core value of DeFi. It also means a system can be used in ways its authors never intended. Assessing those interactions requires experience in protocol security and a broad understanding of how people use smart contracts.

Design patterns. Established standards, including Ethereum Request for Comments (ERC) specifications, and well-understood techniques support robust interactions. Using established patterns for familiar problems allows auditors to focus on the parts of a protocol that are genuinely new.

Economic attacks. Second-order vulnerabilities include the free option problem, impermanent loss, deleveraging, depegs, bad debt and statistical arbitrage. Assessing these risks takes expertise beyond code review, including knowledge of how decentralised financial products behave in practice. Our explanation of front-running vulnerabilities examines one related class of attack.

Governance. What happens if a trusted party is no longer trustworthy? A well-designed protocol uses defence in depth and limits even privileged roles to the minimum permissions needed to perform their functions.

What a Smart Contract Audit Can Establish

An audit gives a high degree of assurance that a system behaves as designed. It is not proof that the code is bug-free or cannot be hacked. That distinction matters when interpreting both the report and the claim that a protocol has been audited.

Scope and time matter. Auditors review specified parts of a system within an agreed timeframe. If a client introduces additional complexity during the engagement, the original estimate may no longer allow the intended level of coverage.

Experienced auditors can still make mistakes. At BailSec, we rigorously test the experienced security researchers we hire. This reduces the chance of missing a substantial vulnerability, but it cannot eliminate human error.

Finding density is a signal. Numerous findings rated Medium or above suggest that more bugs may remain even after the fix review. In that situation, we recommend another round of audits. Good initial design remains essential; our guide to smart contract audit readiness explains how teams can prepare.

Post-audit changes fall outside the original assurance. Auditors cannot ensure that later changes avoid new bugs or preserve the invariants checked during the audit. These invariants are the conditions the system is intended to maintain. Changes after the engagement are made at the project's own risk and are not recommended without further security review.

Formal verification also has limits. It establishes that the reviewed code matches a formal specification, but that specification may be incomplete or miss an attack vector. The code eventually deployed may also differ from the code reviewed. Neither a manual audit nor formal verification can establish that exploitation is impossible.

Security Across the Whole Stack

In our assessment, infrastructure and key compromise are now the largest root cause of losses across the ecosystem by dollar value. Unless explicitly included in the scope, a smart contract audit typically does not review those components.

Modern protocols combine contracts with APIs, front ends, infrastructure and other off-chain systems. Some components contain intellectual property or trade secrets that a project does not disclose to an external contract auditor. A contract review alone therefore cannot establish that the full system preserves the intended security properties.

Good contract design can substantially reduce this risk. Where practical, teams can move off-chain logic fully on-chain and minimise the mutability of on-chain components. Robust, immutable systems allow manual review to eliminate exceptions and assumptions, providing a higher degree of assurance. Off-chain components also need their own security assessment.

What SOC 2 and ISO 27001 Show

Security attestations and certifications address the organisation that builds, deploys and operates a protocol. They help provide assurance about how smart contracts, off-chain components and operational processes work together.

SOC 2 and ISO 27001 address controls such as access management, key management, change management, vendor risk and incident response. Change controls provide assurance that new versions preserve the system's intended invariants. These frameworks also provide evidence that an organisation has taken steps to reduce supply-chain risk, while controls over endpoints and personnel reduce exposure to some insider attacks.

A SOC 2 Type I report reflects controls at a particular point in time. A Type II report covers controls over a period. Neither SOC 2 nor ISO 27001 can prevent every hack, but they reduce risks arising from weaknesses in the components and processes they cover.

These attestations and certifications signal organisational seriousness and maturity. They also show how central security is to the product. Treating them as a rubber stamp overlooks the work required to obtain them. Equally, obtaining them does not mean a company has abandoned a crypto-native ethos.

Users and partners should read the scope and any exceptions. They should not infer that deployed smart contract code is secure: a controls assessment is not a code security audit. As discussed in the interview, deployed contract code is outside that scope, and the company determines the scope of a SOC 2 examination. A Type I report should not be taken as evidence that controls have operated continuously over time.

How Aqua Changes the Threat Model

1inch Aqua combines customisable strategies with shared capital. A maker supplies liquidity through a strategy; a taker interacts with that strategy to execute a trade. The same maker capital can support several strategies at once, increasing capital efficiency while changing the risks that must be assessed.

Strategy Design and Shared Capital

Aqua gives makers considerable flexibility in how they construct strategies. The software used to build those strategies must follow robust compositional rules to avoid invalid configurations that could cause losses. Shared capital also increases a maker's exposure to an economically vulnerable strategy: a single risky strategy can potentially cause losses equal to all the deployed capital.

Takers explicitly select the maker strategies they consider most liquid. This differs from a typical automated market maker (AMM), where multiple liquidity providers pool capital into one strategy and the calculation required to interact with it is independent of the number of providers.

Wallet Liquidity and Allowances

Liquidity stays in the maker's wallet until a taker fills against a position. This eliminates certain classes of attack that can drain funds held in liquidity pools, improving the security posture of the design. Makers can also cut exposure to unwanted strategies by docking them or revoking allowances.

Some risk shifts rather than disappears: from balances held in pools to ERC-20 allowances, the permissions that allow a contract to transfer tokens. In our assessment, the overall security posture is an improvement, but allowance management and strategy security remain important.

Liquidity Accounting and Swap Execution

The smart contracts ensure that liquidity cannot be used twice. However, one strategy can run out of available liquidity because a neighbouring strategy has consumed the shared balance. Off-chain systems unaware of this design may also count that balance more than once, overstating aggregate market depth, total value locked (TVL) or available liquidity.

The order in which takers consume liquidity can affect the price of subsequent swaps. Systems routing through Aqua need enough knowledge of the architecture to sequence interactions carefully. For takers, the main risk is that a maker runs out of capital during a swap because collateral is shared; routing logic must account for that dependency.

Every swap must include an appropriate slippage limit check to guard against adverse execution and attacks involving maximal extractable value (MEV) and front-running. Flexible execution does not remove that requirement.

These points describe Aqua's threat model and integration considerations. They should not be read as a list of vulnerabilities discovered in the audit. The BailSec final security audit report for 1inch Aqua is the reference for the reviewed scope and documented findings. Its conclusions apply to the code and scope identified in that report.

How to Assess an Audited Protocol

Aqua's audit indicates that its authors take security seriously and provides evidence that the system has improved from its initial implementation. Completing an audit with an experienced team moves a protocol towards greater security, but security remains a process rather than a finished state.

Users and partners should consider both the audit evidence and their own exposure:

  • Limit potential losses. Avoid exposing yourself to losses you cannot tolerate from a DeFi position.
  • Quantify risk where possible. Assess whether expected returns are favourable after accounting for the risks.
  • Read the audit report. Examine its scope, findings and limitations instead of treating an audit badge as a guarantee. We recommend reading our reports and make them available through our public audit collection.
  • Use AI summaries as a reading aid. Non-technical readers can use an LLM to summarise findings and ask follow-up questions. Check important conclusions against the report itself.

Frequently Asked Questions

Does a smart contract audit guarantee that a protocol is safe?

No. It provides assurance about the reviewed system, within a defined scope and timeframe. It cannot prove that the code is bug-free or immune to exploitation.

What does a smart contract audit usually leave out?

Unless included in the engagement, it typically excludes off-chain infrastructure, APIs, front ends and key management. Those components need separate attention.

Do SOC 2 or ISO 27001 establish smart contract security?

No. They address organisational controls and the systems within their scope. They do not replace an assessment of deployed smart contract code.

What makes Aqua different from a traditional AMM?

Funds remain in the maker's wallet until a position is filled, and one balance can support multiple strategies. This removes certain classes of pool-draining attack while introducing shared-liquidity dependencies and leaving risks associated with allowances and individual strategies.

For the conversation behind this article, read Vik's full interview on the 1inch blog.

Planning a security review? Contact BailSec about a smart contract audit.

‍

Read the original article

Related articles