BTB
/

BTB Smart Account

Liquidity Managerwebsite
BTB's own non-custodial wallet for automated liquidity. Each user gets one smart wallet (same address on Base and Robinhood Chain) that an automation agent can manage without ever being able to take money out: the agent can open, rebalance, compound, collect, stake and swap within the owner's limits, only through BTB-listed adapters and contracts; withdrawals go only to the owner. Powers auto-rebalance on btb.finance for Aero, Uniswap V3, UP, Giga and Alandale.

What you can do

Create a walletCreate a wallet: factory.createAccount(setup), or the Auto LP flow on btb.finance
Hand a position to automationHand a position to automation: move the position NFT into the wallet and set an agent
WithdrawWithdraw: owner calls withdraw, withdrawNft or withdrawAll; the agent can only sweepToOwner
Not audited (the repo's SECURITY.md and SOLIDITY_RELEASE_REVIEW.md describe the internal review).
BTBRegistry and the factory are admin controlled by the BTB Safe (2-of-3 on both chains); new wallet releases wait 48 hours before applyLatest.
An agent can lose money to bad timing within the owner's limits (rebalances, swaps at the time-weighted price less the owner's slippage) but cannot move funds out of the wallet.

Contracts

Read any function, or build a write and sign it. Amounts are in base units (1 USDC = 1000000).
Wallet factory (current)factory on base0xc922eb8dCF5D61CEeFaeCe86265F5f0D6dC0EC77
write createAccount((address,uint64,uint16,address[],bytes[]))
Create the caller's BTB wallet, directly on the current release. Setup: (agent, agentExpiresAt unix seconds, maxActionsPerDay up to 200, adapters to enable, one config bytes per adapter). The wallet address depends only on the owner, so it is the same on Base and Robinhood Chain.
read accountOf(address)
The owner's wallet address, or zero if none yet (also finds wallets made by the first V6 factory).
read predictAccount(address)
Where the owner's wallet will be, before it is created.
write applyLatest()
Anyone can call: moves new wallets to the queued release once the BTB Safe's 48 hour delay has passed.
Wallet implementation, release 4 (each wallet is a UUPS proxy to this)implementation on base0x46e8403b51c7e2FaB5e35Aa2F942abAc678bf889
write run(address,bytes)
Run one action through an adapter: (adapter, params encoded for that adapter). Owner or the wallet's agent. The adapter must be listed in BTBRegistry and enabled by the owner; the wallet makes every call itself, only to registry-listed targets, with exact approvals it clears afterwards, and the adapter checks the result or everything reverts.
write setAgent(address,uint64)
Owner only: set the automation agent and when its permission expires (unix seconds). The agent can rebalance, compound, collect, stake and swap within the rules, never withdraw.
write setAdapter(address,bool,bytes)
Owner only: enable or disable an adapter for this wallet with its config (adapter, enabled, config).
write setPaused(bool)
Owner only: pause or resume the agent.
write setMaxActionsPerDay(uint16)
Owner only: daily limit on agent actions (at most 200).
write withdraw(address,uint256)
Owner only: send an amount of a token to the owner.
write withdrawNative(uint256)
Owner only: send native ETH to the owner.
write withdrawAll(address[])
Owner only (wallet version 3 and later): every listed token and all ETH to the owner in one call.
write sweepToOwner(address[])
Owner or agent (version 4): same as withdrawAll, and only ever to the owner.
write withdrawNft(address,uint256)
Owner only: send a position NFT (collection, tokenId) to the owner.
read isAgent(address)
True while the address is the wallet's unexpired agent.
read owner()
The wallet's owner.
read VERSION()
Wallet release: 4 is current.
BTBRegistry (adapters, targets, pools, oracles; admin is the BTB Safe)registry on base0xF14D03C30Ae072e1E7c531Ce8e8A2Ed6a7417Eb5
read isAdapter(address)
True if BTB lists the adapter.
read isTarget(address)
True if a wallet may call this contract (position managers, routers, gauges).
read isListedPool(address)
True for admin-listed deep pools, where the agent may open positions.
read oracleFor(address,address)
The pool used as the time-weighted price floor for swaps between two tokens.
Wallet factory (current)factory on robinhood0xc922eb8dCF5D61CEeFaeCe86265F5f0D6dC0EC77
write createAccount((address,uint64,uint16,address[],bytes[]))
Create the caller's BTB wallet, directly on the current release. Setup: (agent, agentExpiresAt unix seconds, maxActionsPerDay up to 200, adapters to enable, one config bytes per adapter). The wallet address depends only on the owner, so it is the same on Base and Robinhood Chain.
read accountOf(address)
The owner's wallet address, or zero if none yet (also finds wallets made by the first V6 factory).
read predictAccount(address)
Where the owner's wallet will be, before it is created.
write applyLatest()
Anyone can call: moves new wallets to the queued release once the BTB Safe's 48 hour delay has passed.
Wallet implementation, release 4 (each wallet is a UUPS proxy to this)implementation on robinhood0x46e8403b51c7e2FaB5e35Aa2F942abAc678bf889
write run(address,bytes)
Run one action through an adapter: (adapter, params encoded for that adapter). Owner or the wallet's agent. The adapter must be listed in BTBRegistry and enabled by the owner; the wallet makes every call itself, only to registry-listed targets, with exact approvals it clears afterwards, and the adapter checks the result or everything reverts.
write setAgent(address,uint64)
Owner only: set the automation agent and when its permission expires (unix seconds). The agent can rebalance, compound, collect, stake and swap within the rules, never withdraw.
write setAdapter(address,bool,bytes)
Owner only: enable or disable an adapter for this wallet with its config (adapter, enabled, config).
write setPaused(bool)
Owner only: pause or resume the agent.
write setMaxActionsPerDay(uint16)
Owner only: daily limit on agent actions (at most 200).
write withdraw(address,uint256)
Owner only: send an amount of a token to the owner.
write withdrawNative(uint256)
Owner only: send native ETH to the owner.
write withdrawAll(address[])
Owner only (wallet version 3 and later): every listed token and all ETH to the owner in one call.
write sweepToOwner(address[])
Owner or agent (version 4): same as withdrawAll, and only ever to the owner.
write withdrawNft(address,uint256)
Owner only: send a position NFT (collection, tokenId) to the owner.
read isAgent(address)
True while the address is the wallet's unexpired agent.
read owner()
The wallet's owner.
read VERSION()
Wallet release: 4 is current.
BTBRegistry (adapters, targets, pools, oracles; admin is the BTB Safe)registry on robinhood0xF14D03C30Ae072e1E7c531Ce8e8A2Ed6a7417Eb5
read isAdapter(address)
True if BTB lists the adapter.
read isTarget(address)
True if a wallet may call this contract (position managers, routers, gauges).
read isListedPool(address)
True for admin-listed deep pools, where the agent may open positions.
read oracleFor(address,address)
The pool used as the time-weighted price floor for swaps between two tokens.
AerodromeCLAdapteradapter on base0x9275baf6E1ea3033AD132956e4347D4d25e96BB6
read plan(address,bytes,uint256,bytes,bool)
Concentrated liquidity on Aero and Aerodrome Slipstream (and UP on Robinhood Chain): open, rebalance, compound, collect, close. Called by the wallet inside run(); agents pass this adapter's address and encoded params to wallet.run.
AerodromeCLAdapteradapter on robinhood0x9275baf6E1ea3033AD132956e4347D4d25e96BB6
read plan(address,bytes,uint256,bytes,bool)
Concentrated liquidity on Aero and Aerodrome Slipstream (and UP on Robinhood Chain): open, rebalance, compound, collect, close. Called by the wallet inside run(); agents pass this adapter's address and encoded params to wallet.run.
UniswapV3Adapteradapter on base0x3801B52d9011901A7fAEf1FDb34C9E2ebdECa715
read plan(address,bytes,uint256,bytes,bool)
Uniswap V3 liquidity: open, rebalance, compound, collect, close. Called by the wallet inside run(); agents pass this adapter's address and encoded params to wallet.run.
UniswapV3Adapteradapter on robinhood0x3801B52d9011901A7fAEf1FDb34C9E2ebdECa715
read plan(address,bytes,uint256,bytes,bool)
Uniswap V3 liquidity: open, rebalance, compound, collect, close. Called by the wallet inside run(); agents pass this adapter's address and encoded params to wallet.run.
RouterSwapAdapteradapter on base0x5A72E43960F4dA336a6459391CDEeD680D4084c8
read plan(address,bytes,uint256,bytes,bool)
Swaps through KyberSwap and Uniswap routers, floored by a time-weighted price. Called by the wallet inside run(); agents pass this adapter's address and encoded params to wallet.run.
RouterSwapAdapteradapter on robinhood0x5A72E43960F4dA336a6459391CDEeD680D4084c8
read plan(address,bytes,uint256,bytes,bool)
Swaps through KyberSwap and Uniswap routers, floored by a time-weighted price. Called by the wallet inside run(); agents pass this adapter's address and encoded params to wallet.run.
AeroGaugeAdapteradapter on base0x8e5a57b34B6fC7ebED179930d2202912f8b39399
read plan(address,bytes,uint256,bytes,bool)
Stake, claim (claimEmissions) and unstake on Aero gauges. Called by the wallet inside run(); agents pass this adapter's address and encoded params to wallet.run.
AeroGaugeAdapteradapter on robinhood0x8e5a57b34B6fC7ebED179930d2202912f8b39399
read plan(address,bytes,uint256,bytes,bool)
Stake, claim (claimEmissions) and unstake on Aero gauges. Called by the wallet inside run(); agents pass this adapter's address and encoded params to wallet.run.
MasterChefV3Adapteradapter on robinhood0x0993a62835e7c1534C2f3525828Ec9f3e60781AB
read plan(address,bytes,uint256,bytes,bool)
Stake, claim and unstake in MasterChef V3 farms (Giga). Called by the wallet inside run(); agents pass this adapter's address and encoded params to wallet.run.
AlgebraAdapteradapter on robinhood0x5116F68d95b6d8584A47CDAA66A5ec2441b9E458
read plan(address,bytes,uint256,bytes,bool)
Algebra Integral liquidity (Alandale) plus signed LUTE reward claims. Called by the wallet inside run(); agents pass this adapter's address and encoded params to wallet.run.