Aqua SDK

The 1inch Aqua SDK is the official TypeScript toolkit for 1inch Aqua, the shared liquidity layer. It builds typed call data for the registry's core maker operations — ship and dock — decodes the registry events (Shipped, Pushed, Pulled, Docked), and bundles pre-configured contract addresses for all supported networks.

Install

Bash
1
pnpm add @1inch/aqua-sdk

The SDK produces ready-to-send transaction objects; the end-to-end examples in the package README send them with viem, but any EVM client works.

Ship and dock a strategy

AquaProtocolContract encodes the maker calls against the Aqua registry. ship() opens a strategy by setting its virtual token balances; dock() closes it and withdraws whatever remains. Strategy bytes are defined by the target AquaApp — each app declares its own schema, so encode them to match the app's contract (see Build an AquaApp).

TypeScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import {
  AquaProtocolContract,
  AQUA_CONTRACT_ADDRESSES,
  Address,
  HexString,
  NetworkEnum,
} from '@1inch/aqua-sdk';

const aqua = new AquaProtocolContract(
  AQUA_CONTRACT_ADDRESSES[NetworkEnum.ETHEREUM],
);

// Open the strategy with maker funding
const shipTx = aqua.ship({
  app: new Address('0x...'), // your AquaApp contract
  strategy: new HexString('0x...'), // strategy bytes, encoded per the app's schema
  amountsAndTokens: [
    { token: new Address('0x...'), amount: 1000000000000000000n },
  ],
});
// shipTx is { to, data, value } — sign and send it with your wallet client

// Close the strategy and withdraw remaining balances
const dockTx = aqua.dock({
  app: new Address('0x...'),
  strategyHash: AquaProtocolContract.calculateStrategyHash(
    new HexString('0x...'),
  ),
  tokens: [new Address('0x...'), new Address('0x...')],
});

AQUA_CONTRACT_ADDRESSES resolves to the same registry address — 0x1111113ccf1426a8e30e2bff5e005d929bf6a90a — on every supported network (Ethereum, Base, Arbitrum, Optimism, Polygon, BNB Chain, and more).

Decode registry events

Every registry event has a decoder class — ShippedEvent, PushedEvent, PulledEvent, DockedEvent — with a fromLog() factory, so you can track strategy activity from raw logs (or discover strategies through the Aqua API):

TypeScript
1
2
3
4
5
6
7
8
9
10
11
import { PushedEvent, ShippedEvent } from '@1inch/aqua-sdk';

const pushed = PushedEvent.fromLog({ data: log.data, topics: log.topics });
pushed.maker; // Address
pushed.app; // Address
pushed.strategyHash; // HexString
pushed.token; // Address
pushed.amount; // bigint

const shipped = ShippedEvent.fromLog(log);

Did you find what you need?