OneTx

Swift protocol for defi

OneTx Contract Interfaces

Discover and trade yield-bearing assets with just two simple functions

The OneTx protocol makes it incredibly easy to discover and trade yield-bearing assets. With just two functions, you can browse all available products and execute trades that automatically earn yield for you. All in one transaction.

Contract Address

The AdapterRegistry contract is deployed at 0x7425AAa97230f6D575193667cfd402b0B89C47f2

on the Base Sepolia testnet.

Interfaces

getAllRegisteredAdapters

Discover all available yield-bearing assets. Returns a list of all registered adapters with their details.

function getAllRegisteredAdapters()
  external view
  returns (AdapterInfo[] memory)

Returns

NameTypeDescription
adaptersAdapterInfo[]Array of all registered adapters

AdapterInfo structure:

adapterAddress:address
ensNode:bytes32
domain:string
adapterId:string

swap

Execute a trade and automatically receive yield-bearing tokens. The swap deposits your output tokens into the lending protocol and returns yield-bearing tokens to you.

function swap(
  PoolKey calldata key,
  IPoolManager.SwapParams calldata params,
  bytes calldata hookData
) external returns (BalanceDelta)

Parameters

NameTypeDescription
keyPoolKeyThe pool to swap against
paramsSwapParamsThe swap parameters (amount, limits)
hookDatabytesEncoded adapterId and recipient address

Returns

NameTypeDescription
deltaBalanceDeltaThe balance changes from the swap

Quick Start Example

Here's how simple it is to discover and trade yield-bearing assets:

import { createPublicClient, createWalletClient, http, encodeAbiParameters } from 'viem';
import { baseSepolia } from 'viem/chains';

// Step 1: Discover all available products
const products = await publicClient.readContract({
  address: '0x7425AAa97230f6D575193667cfd402b0B89C47f2',
  abi: registryABI,
  functionName: 'getAllRegisteredAdapters'
});

// Step 2: Trade and earn yield automatically
const hookData = encodeAbiParameters(
  [{ type: 'string' }, { type: 'string' }],
  [products[0].adapterId, myAddress]
);

await walletClient.writeContract({
  address: SWAP_ROUTER_ADDRESS,
  abi: swapRouterABI,
  functionName: 'swap',
  args: [poolKey, swapParams, hookData]
});

// Done! You now hold yield-bearing tokens

That's it!

One function to discover products, one function to trade. The protocol handles everything else: depositing to lending protocols, minting yield-bearing tokens, and sending them to you.

Other Contract Addresses

Base Sepolia testnet:

SwapDepositor Hook:0x1d16EAde6bE2D9037f458D53d0B0fD216FC740C4
Pool Manager:0x7Da1D65F8B249183667cdE74C5CBD46dD38AA829
USDT Adapter:0x6F0b25e2abca0b60109549b7823392e3312f505c
USDC Adapter:0x6a546f500b9BDaF1d08acA6DF955e8919886604a