Skip to main content

Setup your development environment

Follow these steps to integrate 1tx into your application.

Option 1: Direct Smart Contract Integration

Perfect for DeFi protocols and wallets that want to interact directly with our contracts.
1

Install Dependencies

Install the necessary packages:
2

Configure Contract Addresses

Import the deployed contract addresses (Base Mainnet):
3

Make Your First Buy

Execute a buy into Aave USDC using the 1tx router:
Use minDepositedAmount to enforce your minimum acceptable output. For same-asset deposits such as Aave USDC, 0n is fine because no internal swap is needed.To earn a referral fee, pass referralFeeBps (up to 500 = 5%) and a non-zero referralWallet. The fee is taken from the input USDC before swap/deposit.
The deployment set in 1tx-contracts/docs/deployments.md uses SwapDepositRouter.buy() and sell() on Base, Arbitrum, and Unichain.

Contract Addresses

Need the full multi-chain deployment set? See Contract Addresses for Base, Arbitrum, and Unichain router, registry, adapter, and bridge addresses.

Option 2: REST API Integration

Perfect for applications that need instrument discovery, calldata generation, and cross-chain execution tracking.
1

Get Your API Key

Sign up at https://app.1tx.fi/api-keys to get your API key.
2

Make Your First Request

Fetch all available instruments:
3

Query Specific Instrument

Get details for a specific instrument:
4

Build Buy Calldata

Send the returned transactions in order with the user’s wallet.
5

Monitor Cross-Chain Completion

After the source transaction confirms, poll relay status by source tx hash:
A brief 404 Job not found immediately after source-chain confirmation is expected while the bridge webhook is being ingested.

Option 3: Embedded Wallet Integration

Perfect for AI agents and robo-advisors that need automated trading.
1

Install Privy SDK

2

Configure Privy Provider

3

Create Session Keys

Enable automated trading within limits:

Example Use Cases

Wallet Integration

Let users deposit to any protocol from any token

AI Agent

Build autonomous yield optimization strategies

Exchange

Offer institutional DeFi access to your users

DeFi Protocol

Accept deposits in any token, not just your native token

Next Steps

Read How It Works

Understand the architecture in detail

Core Concepts

Learn about universal instrument IDs

View API Docs

Explore all available endpoints

Integration Patterns

Choose the best integration for your use case