Odos

Odos compact calls reduced calldata while retaining Router V3 swap checks

Odos compact calls described legacy swaps with less transaction data than standard calls, while using the same Router V3 swap logic. Their Yul decoder reconstructed swap parameters, and optional cached addresses exchanged calldata for storage reads. Savings depended on those costs; the operating company scheduled permanent service closure for July 30, 2026.

updated

Key takeaway: Router V3's shared swap logic meant compact encoding retained output checks even when the transaction data changed.

Call encoding and swap shape described separate choices

Standard and compact described how a call carried swap instructions; single and multi-token described the exchange that those instructions requested. Router V3 distinguished these choices within its swap interface. A single-input, single-output exchange could use the dedicated single-swap logic. Exchanges involving sets of inputs or outputs used the multi-token logic. Both families had compact options, so compactness alone did not identify how many tokens participated in the exchange.

Comparing a standard single-swap call with a compact multi-token call changed both properties. Their cost difference could therefore reflect the exchange requirements as well as the encoding.

The shared swap functions preserved settlement checks

Ordinary and compact entry points converged on the same internal swap functions after preparing their parameters and token transfers. Router V3 used _swap for the single-swap family and _swapMulti for the multi-token family. A smaller payload still carried amounts, recipients, and minimum-output conditions. After execution, the shared routines reverted the swap if any final output fell below its specified minimum.

What did the Yul decoder change?

Router V3's compact options used a custom Yul decoder to describe swaps with less calldata than the normal endpoints. Calldata was the input data carried with a contract call. The decoder reconstructed instructions from the compact representation before the internal swap logic used them. The design also sought more efficient decoding. This optimization concerned the incoming request's representation; the routing algorithm separately searched for exchange paths.

Compact and ordinary representations described equivalent requests only when decoding preserved the intended values.

The address list exchanged transmitted data for storage reads

Cached addresses let compact calls refer to existing router storage instead of carrying the full address value in calldata. The decoder needed a storage read to retrieve an address that the call represented through the list. That read incurred an execution cost, while the shorter reference reduced transmitted data. This substitution favored environments where the SLOAD storage-read operation cost less than passing the full value. Compact calls could also carry addresses directly.

The list's stability mattered because an encoded reference depended on the address stored at its position. Router V3's owner could append new addresses without changing or removing existing list entries. The owner used writeAddressList to extend it. Calling the list immutable described the preservation of existing entries; it did not mean that its length could never grow.

The retrieved value supplied an address field in the decoded request. Token authorization and route execution followed the separate functions that used that field.

When did fewer bytes reduce the transaction bill?

Fewer bytes reduced the bill when their data-cost savings outweighed any additional execution costs in the applicable network environment. The address-list mechanism made that condition concrete: shorter references saved calldata, while retrieving their values required storage reads. A compact payload's byte count described one cost input. The network's pricing of transaction data and execution determined how that input affected the bill. Storage access and decoding therefore belonged in the same comparison as the transmitted data.

The exchange itself also required work beyond decoding. Token transfers and the executor's contract interactions contributed to execution costs. These costs did not disappear because the outer call used a smaller format. Router V2's compact-calldata announcement emphasized transaction costs on Layer 2 rollups, where reducing transmitted data could help. It did not establish a fixed saving for every call. A favorable comparison could change when data pricing, storage costs, or the required exchange operations changed.

Single and multi-token calls had different cost baselines

Router V3's dedicated single-swap logic was slightly more gas efficient than its multi-token logic for single-input, single-output exchanges. That difference came from the swap family, alongside any encoding savings. The multi-token family supported atomic exchanges involving multiple inputs or outputs, which served different requirements. The multi-token path retained the processing needed to handle the requested input and output collections. Comparing ordinary and compact forms within the same family kept the encoding question separate from that change. Atomic multi-token execution also remained distinct from assembling several separate exchanges.

Comparable legacy calls kept the same exchange requirements

A comparison of standard and compact Router V3 calls isolated encoding costs only when the underlying exchange requirements remained the same. The dedicated single-swap and multi-token families provided documented alternatives, while address caching introduced a conditional trade-off inside the compact format.

  • Match the router version and swap family before attributing a difference to compact encoding.
  • Keep the requested inputs, outputs, recipients, and minimum-output conditions equivalent.
  • Separate directly encoded addresses from cached references that required storage reads.
  • Require the selected entry point to support the intended authorization and any output-hook arguments.
  • Include execution costs alongside calldata costs for the relevant network conditions.

Approval handling followed the selected entry point

Router V3 supported direct router approvals and Permit2 through external interfaces for its single and multi-token swap families. For ERC-20 inputs, the plain swapCompact and swapMultiCompact entry points used direct router approvals; Permit2 transfers used separate entry points. Encoding and authorization therefore answered different questions. A compact payload described instructions efficiently, while token permissions determined how the selected entry point obtained the inputs. Comparing a compact direct-approval call with a Permit2 call could change both dimensions. Any resulting cost difference could include transfer handling as well as the representation of the swap instructions.

Payload size did not determine routing quality or output fees

Routing quality depended on the exchange path and available liquidity, while compact encoding concerned how the router received the request. Encoding the same exchange more efficiently could affect transaction costs while leaving its requested economic terms intact. Quoted output and execution price followed the exchange path, not the byte count of its outer call. Minimum-output conditions continued to bound what the router would accept. A change to the path or decoded parameters changed the economic comparison.

Configured referral fees were charged on swap outputs, which gave them a different basis from the network's transaction bill. Sharing internal swap logic meant that compactness did not itself remove those fees. The router also had positive-slippage revenue mechanisms, separate from calldata pricing. Reducing transmitted data addressed a transaction-cost component, while output accounting governed the tokens available after execution. Neither the compact label nor an address-list reference specified a fee-free exchange.

Router versions and external formats remained distinct

Compact calldata appeared in Router V2's release, and Router V3 incorporated compact options within its own swap interface. The optimization's purpose continued across these designs. Each contract version nevertheless supplied the decoder that interpreted its incoming bytes. A compact request belonged to that decoder's format, including its parameter representation and internal destination. Version-specific details therefore remained relevant when interpreting historical payloads or comparing legacy interfaces.

Within Router V3, single and multi-token calls also remained separate formats. They carried different arrangements of token information even though both belonged to the compact family. The relevant decoder determined how that information was read. Optional output hooks added an operation after the swap, with corresponding external interfaces. Hook arguments and Permit2 authorization belonged to the entry points that accepted them. Overall router support for these features covered a broader set of interfaces than the plain compact functions.

What did the shutdown mean for compact-call integrations?

The operating company set July 30, 2026, as the permanent closure date for the hosted services supporting these swaps. Its schedule placed the app in read-only mode on July 27. Published code retained information about that design, while service availability followed the wind-down schedule. The team stated that it would provide no further development, support, or maintenance after closure. The app's retirement was separate from the continued existence of onchain assets.

A historical cost advantage applied under its original execution and pricing conditions. Different router interfaces or network costs could change that comparison.

Visual outline: What did the shutdown mean for compact-call integrations? (Odos)

View full-size image

Helpful answers about Odos

How many bytes did a cached address occupy in Router V3 compact data?

A cached address reference occupied two bytes. A directly encoded nonzero address in a field that supported caching used a two-byte indicator followed by its 20-byte value. These were address-field sizes, not total payload sizes or gas savings.

What did a zero input amount mean in a compact call?

A zero input amount selected the caller's full balance of the specified ERC-20 token in Router V3's direct-approval path. For a native-asset input, it selected the transaction's supplied value, rather than the wallet's entire native balance.

Where did the output go if the compact call encoded a zero receiver?

A zero output receiver directed the output to the caller in Router V3. This shorthand applied to the output receiver field. Zero addresses had separate meanings in other fields.

Could Router V3's compact entry points also request an output hook?

The plain compact entry points did not accept explicit output-hook arguments. Router V3 exposed separate swap-with-hook functions. Overall hook support therefore did not make hook arguments part of every compact format.

How was the minimum acceptable output represented in a compact call?

Router V3's compact decoder calculated the minimum output from the encoded quote and slippage tolerance. The ordinary interface accepted an explicit minimum-output value. Equivalent comparisons required matching decoded thresholds despite the different representations.