Overview
1tx enables single-transaction, cross-asset deposits through a router + registry architecture:SwapDepositRouter.buy()is the user entry point.InstrumentRegistryresolves the instrument ID into an adapter + market.SwapPoolRegistryprovides the default swap pool when the market asset differs from the router’s configured stable token.- The router executes the swap through
poolManager.unlock(...)andSwapExecutor. - The protocol adapter completes the final deposit through
LendingExecutor.
Router Flow
For withdrawals the same path runs in reverse throughsell(): 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:
- 1tx ingests the source-chain bridge event.
- 1tx polls Circle IRIS for attestation.
- 1tx submits
CCTPReceiver.redeem(...)on the destination chain. CCTPReceiverfinalizes the bridge and executesbuyFor(...).
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
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