Prepare: trade through the trade account
account_tradeUnsigned transactions to open or close a short or a leveraged long through the trade account: the same trades as open_short, close_short, open_long and close_long, with the account as the trader. action open_short (symbol, amount, deposit), close_short (symbol: all of the account's short on it), open_long (symbol, margin, leverage) or close_long (symbol, percent). The account pays from its own USDG; when it holds too little, a USDG transfer from the wallet to the account comes before the trade (from the agent's wallet with fund_from_wallet: true alone, since the agent's own USDG then becomes the owner's and can go out to the owner alone, never back to the agent). What a close returns stays in the account as USDG (account_withdraw takes it out). The wallet must be the account's owner or its agent; the agent's trades must price within its slippage of the stock's feed (refused in words when the pool is further off). The agent's opens need room in the daily loss budget the owner set: refused in words when it is 0 or today's loss has reached it (until 00:00 UTC), and by the account when the open's own shortfall against the feed would pass it. Its closes run whatever the budget (any share, within its slip), counted into today's loss, past the budget by at most their own shortfall. The answer says how much of the budget is left.
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>",
"action": "<action>",
"symbol": "<symbol>"
},
"name": "account_trade"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | open_short, close_short, open_long or close_long | |
| amount | No | open_short: stock to short, in whole units as a decimal string, like "1.5" | |
| margin | No | open_long: USDG margin, in whole units as a decimal string, like "1.5" | |
| symbol | Yes | A stock on Borro by its ticker, like NVDA or AAPL (markets lists every one) | |
| wallet | Yes | The wallet's address (0x...); the transactions are built for it to sign | |
| account | No | A trade account's address (default: the wallet's own, as its owner; an agent gives its owner's account) | |
| deposit | No | open_short: USDG held beyond the sale (optional), in whole units as a decimal string, like "1.5" | |
| percent | No | close_long: how much to close, 1 to 100 (default 100) | |
| leverage | No | open_long: leverage, more than 1, like 1.5 | |
| fund_from_wallet | No | The agent signing: true to send its own USDG into the owner's account when the account holds too little (it becomes the owner's; it can go out to the owner alone) |