Prepare: open a trade account
account_openUnsigned transaction opening the wallet's version 2 trade account (a TradeAccountV2, one per owner, made by TradeAccountFactoryV2): a trade account with Bailouts, where the owner may post standing offers that pay rescuers to save a position instead of letting it be liquidated (bailout_offer). An agent may be named: an optional second key, never the wallet itself, that can open and close positions within its slippage of the stock's feed, set triggers and cancel the ones it set, post offers within the owner's cap, and send money out to the owner alone. Positions opened inside the account can carry triggers (stop-loss, take-profit, liquidation guard) that anyone can execute for a tip once the price feed confirms them; positions opened from the wallet cannot (close them and open them again inside). Whenever no bailout is owed the owner can take everything out at any time and nobody, Borro included, can stop that; while one is owed, the owner's way out is to pay it (bailout_repay), which lifts the lien at once. A version 1 account the wallet holds stays as it is and keeps working; the other trade tools take either. With a version 2 account open already: agent names a new agent (the old agent's triggers and offers are cancelled with it), revoke_agent: true revokes it at once; account names which of the wallet's accounts to change (default its version 2 one). The owner's settings, on a new account or an open one: the agent's limits (agent_slip_bps, agent_max_tip_bps, agent_max_margin_usdg, agent_daily_loss_usdg, agent_restricted; the agent opens nothing, takes no deposit out, sets no trigger and posts no offer until it has a daily loss budget, and closes whatever the budget; it tips nothing until it has a max tip), agent_bailout_max_usdg (the most an agent's offer may put at stake, 0 by default: none) and max_slip_bps, how far a stop's or a guard's fire bound may widen past its slip (while an offer is live or a bailout is owed it may come down and never up). Simulated from the wallet.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"wallet": "<wallet>"
},
"name": "account_open"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | The agent's address (optional): a second key that may trade the account and set triggers, never the wallet itself | |
| wallet | Yes | The wallet's address (0x...); the transactions are built for it to sign | |
| account | No | Which of the wallet's trade accounts to change (default its version 2 account; give its version 1 account to change that one) | |
| max_slip_bps | No | How far a stop's or a guard's fire bound may widen past its slip over time, in hundredths of a percent (0: no further, up to 1000) | |
| revoke_agent | No | With an account open: revoke its agent at once | |
| agent_slip_bps | No | The most the agent's trades and triggers may price from the feed, in hundredths of a percent (100 to 300, default 100) | |
| agent_restricted | No | true: the agent opens on the desks the owner allows (setAgentMay) alone | |
| agent_max_tip_bps | No | The most tip the agent's triggers may pay executors (a share of the closed notional at the feed, capped (tip_bps, at most 50 basis points, and never more than the USDG the close returns)), in hundredths of a percent (0 to 50, default 0: its triggers then pay none) | |
| agent_daily_loss_usdg | No | The most the agent's fills (and the fires of the triggers it set) may cost against the feed in all each UTC day, renewed at 00:00 UTC (default 0: no agent opens, deposit withdrawals or triggers; its closes run whatever the budget), in whole units as a decimal string, like "1.5" | |
| agent_max_margin_usdg | No | The most equity one position may hold after the agent's trade, or "none" (default none), in whole units as a decimal string, like "1.5" | |
| agent_bailout_max_usdg | No | Version 2: the most an offer the agent posts may put at stake (max_usdg), or "none" (default none: the agent posts no offers), in whole units as a decimal string, like "1.5" |