Skip to main content

Overview

1tx enables single-transaction, cross-asset deposits through a router + registry architecture:
  1. SwapDepositRouter.buy() is the user entry point.
  2. InstrumentRegistry resolves the instrument ID into an adapter + market.
  3. SwapPoolRegistry provides the default swap pool when the market asset differs from the router’s configured stable token.
  4. The router executes the swap through poolManager.unlock(...) and SwapExecutor.
  5. The protocol adapter completes the final deposit through LendingExecutor.

Router Flow

For withdrawals the same path runs in reverse through sell(): the router burns the user’s yield token position, exits the lending market, and swaps back into the desired output token when needed.

Cross-Chain Deposits

If the target instrument lives on another supported chain, SwapDepositRouter.buy() can route through the CCTP bridge path. The router transfers stable tokens to CCTPBridge, encodes instrumentId, recipient, and minimum output into the bridge payload, and emits CCTPBridgeInitiated. That event starts the backend relay flow:
  1. 1tx ingests the source-chain bridge event.
  2. 1tx polls Circle IRIS for attestation.
  3. 1tx submits CCTPReceiver.redeem(...) on the destination chain.
  4. CCTPReceiver finalizes the bridge and executes buyFor(...).
sell() remains local-chain only in the current implementation.

Security Features

Atomic Execution

All steps succeed or fail together - no partial state

Reentrancy Protection

All external calls protected with reentrancy guards

Slippage Control

User can specify max slippage for swaps

Access Control

Only authorized adapters can register instruments

Gas Optimization

1tx is optimized for minimal gas costs:
  • Packed Storage: Instrument IDs encode chain ID + protocol data in 32 bytes
  • Single Transaction: All operations in one tx (no approve + deposit sequence)
  • Minimal Lookups: O(1) instrument and pool queries
  • Efficient Swaps: Leverages Uniswap V4’s efficient swap routing
The router avoids multi-transaction user flows by combining swap and deposit logic into one call, while keeping swap routing and lending execution separated internally.

Next Steps

Core Concepts

Learn about universal instrument IDs

Atomic Router

Understand single-transaction execution

Integration Guide

Start integrating 1tx

API Reference

Explore REST API