Wallet and approvals
Understand wallet connections, network switching, ERC-20 approvals, router trust, and trading-agent policies.
Connect a wallet
Timu uses a wallet connection to read your address and submit transactions. The connected chain controls which markets, contracts, and account data are available.
If a page looks empty, first check your wallet network.
The protocol can validate ordinary EOA signatures and supported ERC-1271 contract-wallet signatures, including compatible Safe or EIP-7702-delegated wallets. Signature validation still leaves account identity, authorization, and action gates to check. This does not establish that every wallet connector, frontend flow, or action supports those wallets.
ERC-20 token approvals
ERC-20 approvals let a contract spend a token from your wallet. You may need approvals for:
- collateral deposits
- price market trades
- LP deposits
Review the spender, token, and amount before approving.
Router approval for your margin account
A token allowance is not the same as trusting a router on your margin account. These are separate gates:
- The token allowance covers what a contract may pull from your wallet.
- The router approval covers whether a specific router deployment may act on your margin account at all.
In v24, router approval is a two-step, owner-authorized flow on the margin account:
proposeAccountRouterV24(approval, ownerSignature)records a candidate router, its identity hash, the expected router epoch, an approval nonce, and a validity window. The owner can submit the proposal directly, or anyone can relay an owner-signed approval on the owner's behalf.activateAccountRouterV24()takes effect only after the proposal'svalidAftertime and beforevalidUntil. Activation checks the router authority's live state: the candidate must be the authority's active router, its identity hash must match, and the router epoch must still be current.
The owner can cancel a pending proposal with cancelAccountRouterV24(). Read the current and pending state with accountRouterBindingV24().
A router rotation that changes the accepted epoch also invalidates installed trading-agent policies, which must be installed again against the new epoch.
Routed account actions revert until an activated router is bound to that account. Verify the pending router and its identity before activating, because the bound router defines which contract may execute account actions.
Trading agents (session keys)
You can authorize a hot key to trade through your margin account without signing each order yourself. The owner calls setTradingAgentV24(request) to install a complete policy, and revokeTradingAgentV24(agent, expectedAuthNonce) to remove it immediately. Both are owner-only.
A v24 agent policy is explicit and complete when installed:
- the agent address and an expiry timestamp,
- an action bitmap selecting from open, add collateral, reduce leverage, close partial, and close all,
- a sorted list of allowed pools,
- per-action and cumulative notional caps, a daily volume cap, a leverage cap, a collateral-spend cap, and a protocol-fee cap,
- a
maxKeeperFeecap, and - a policy hash binding every field, plus the auth nonce that prevents replaying an old policy.
An agent cannot withdraw from the account, deposit to it, run LP actions, change the router approval, or manage other agents. For the five margin-position trading actions, Agents sign policy-bound intents rather than the older exact margin orders, which are Owner-only. The intent uses the agent's own wallet as maker and binds expectedAgentPolicyHash to the currently installed policy. Reinstalling or renewing a policy changes that binding, so an intent signed for the old hash cannot execute. A nonzero keeper fee is allowed, but it is paid from the agent's wallet and must stay within the policy's maxKeeperFee.
A trading agent is a hot key bounded by its installed policy. If it is compromised, the holder can take every action the policy allows until it expires or you revoke it. Install narrow limits and short expiries, and revoke keys you no longer use.
Check an installed agent
The 0.5.1 / V24 Revision 2 source at bcce667b exposes three reads. Query them at the same block when possible:
getTradingAgentV24(agent)returns the installed policy, including expiry and limits.getTradingAgentUsageV24(agent)returns its policy hash, activation Router epoch, cumulative notional used, current UTC day index, and that day's volume used. Across a UTC day boundary the read reports zero for the new day until use resumes; reading does not write storage.getTradingAgentPoolsV24(agent)returns the policy hash and allowed pools. Match its hash to the policy and usage reads.
Also compare the account's accountRouterBindingV24() and the Router Authority's live epoch and identity. Expiry, revocation, an obsolete Router epoch, or an unreadable authority can prevent execution. Historical usage may remain after revocation; nonzero usage does not prove a live authorization. Show failed or inconsistent reads as unknown, rather than zero usage or an active session. An allowed pool is not proof that its margin-new-risk gate, oracle, or other trading checks pass. These reads are source capabilities, not a statement that the current app exposes them.
See Position modes and margin accounts for how the margin account works, and Orders for how orders and keeper fees work.
Network switching
Some Timu features exist only on specific networks. For example, local markets, Base Sepolia deployments, Base deployments, and staking contracts may not all exist on the same chain.
Switch networks from your wallet or the app network selector when a feature is unavailable.
Transaction prompts
Wallet prompts show the final transaction you are about to sign, but they may not explain the market-specific risk. Read the market page and use previews where available before confirming.