{"protocolVersion":"2025-06-18","capabilities":{"tools":{"listChanged":false}},"agentGuidance":{"description":"General guidance for external AI agents using this MCP server. Read before selecting a project endpoint, requesting tool schemas, or calling protocol tools.","skillUrl":"https://erc8004.heyanon.ai/mcp/skill.md"},"serverInfo":{"name":"heyanon-erc8004-derive","version":"1.0.0"},"tools":[{"name":"getDescription","description":"Explain how to use Derive through this module and which networks it supports: markets, account reads, orders and funds, which tools return public data, unsigned Derive API requests or unsigned Ethereum transactions, and how to sign and send the requests. Use for how-to questions about Derive.","inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"title":{"type":"string","description":"Guide title"},"summary":{"type":"string","description":"What Derive is and where it settles"},"supportedNetworks":{"type":"array","items":{"type":"string"},"description":"Networks where deposits are made and withdrawals settle"},"scope":{"type":"string","description":"How to use this guide"},"responseKinds":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["publicData","privateReadRequests","publicDataWithPrivateReadRequests","stateChangeRequests","ethereumTransactions"],"description":"What the tools of this group return"},"responseField":{"type":"string","description":"Response field that carries it"},"returns":{"type":"string","description":"What the caller does with it"},"tools":{"type":"array","items":{"type":"string"},"description":"Tool names"}},"required":["kind","responseField","returns","tools"],"additionalProperties":false},"description":"Which tools return public data, unsigned Derive API requests or unsigned Ethereum transactions"},"signing":{"type":"object","properties":{"recipe":{"type":"string","description":"How to complete and send the unsigned Derive API requests"},"headers":{"type":"object","properties":{"wallet":{"type":"string"},"timestamp":{"type":"string"},"signature":{"type":"string"}},"required":["wallet","timestamp","signature"],"additionalProperties":false,"description":"Login header names of every private request"},"placeholders":{"type":"object","properties":{"timestamp":{"type":"string"},"loginSignature":{"type":"string"},"actionSignature":{"type":"string"}},"required":["timestamp","loginSignature","actionSignature"],"additionalProperties":false,"description":"Placeholder values to replace: the two login headers and body.signature of a request with toSign"},"points":{"type":"array","items":{"type":"string"},"description":"Further signing rules"}},"required":["recipe","headers","placeholders","points"],"additionalProperties":false,"description":"Signing recipe of the unsigned Derive API requests"},"notRunHere":{"type":"array","items":{"type":"string"},"description":"Checks and steps of the original Derive integration that this module no longer runs, and what replaces them"},"sections":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"points":{"type":"array","items":{"type":"string"}}},"required":["title","points"],"additionalProperties":false},"description":"Interaction guide by topic"}},"required":["title","summary","supportedNetworks","scope","responseKinds","signing","notRunHere","sections"],"additionalProperties":false}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getSupportedChains","description":"Get supported chains for Derive: Ethereum, where deposits are made and withdrawals settle, and the networks a withdrawal can be forwarded to.","inputSchema":{"type":"object","properties":{},"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"protocol":{"type":"string","description":"Protocol name"},"chains":{"type":"array","items":{"type":"object","properties":{"chainName":{"type":"string","description":"Chain name"},"chainId":{"type":"number","description":"EVM chain ID"}},"required":["chainName","chainId"],"additionalProperties":false},"description":"Chains this module builds for: deposit transactions run there and every withdrawal and transfer settles there"},"settlementChain":{"type":"object","properties":{"chainName":{"type":"string","description":"Chain name"},"chainId":{"type":"number","description":"EVM chain ID"}},"required":["chainName","chainId"],"additionalProperties":false,"description":"Chain where Derive settles deposits, withdrawals and transfers in batches"},"withdrawalDestinations":{"type":"array","items":{"type":"object","properties":{"chainName":{"type":"string","description":"Destination chainName accepted by withdrawFromDerive"},"forwarded":{"type":"boolean","description":"True when Derive forwards the payout from Ethereum to this chain, a few minutes later"},"assets":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Derive assets forwarded there (as last checked; withdrawFromDerive checks the live route); null: any asset, paid as its Ethereum token"}},"required":["chainName","forwarded","assets"],"additionalProperties":false},"description":"Networks a withdrawal can be received on"}},"required":["protocol","chains","settlementChain","withdrawalDestinations"],"additionalProperties":false}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getBalances","description":"Get the Derive balances of the wallet given as userAddress: total equity, each asset held or borrowed across subaccounts, and per subaccount the collateral amounts with USD value and pending interest, equity and margin headroom. Public data read by the module; nothing to sign. A wallet without a Derive account gets empty data and a note.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."}},"required":["userAddress"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"wallet":{"type":"string","description":"Checksummed wallet address whose Derive account was read"},"totalEquityUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sum of the equity of the subaccounts read, in USD, to cents; decimal string, null when unavailable"},"assets":{"type":"array","items":{"type":"object","properties":{"asset":{"type":"string","description":"Derive asset name"},"held":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact sum held over the subaccounts, in the asset; decimal string, null when unavailable"},"heldValueUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"USD value of held, to cents; decimal string, null when unavailable"},"borrowed":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact sum borrowed over the subaccounts, in the asset, without sign; decimal string, null when unavailable"},"borrowedValueUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"USD value of borrowed, to cents, without sign; decimal string, null when unavailable"}},"required":["asset","held","heldValueUsd"],"additionalProperties":false},"description":"Each asset over the subaccounts, holdings and borrows apart; largest holding first"},"subaccounts":{"type":"array","items":{"type":"object","properties":{"subaccountId":{"type":"number","description":"Derive subaccount ID"},"riskUniverse":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Name of the risk universe whose markets the subaccount trades; null when the names could not be read"},"marginType":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SM (standard) or PM2 (portfolio) margin"},"idle":{"description":"Marks the fallback subaccount: a holding area whose funds cannot trade and count as no margin until moved to a trading subaccount","type":"boolean","const":true},"equityUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Mark value of the collateral and positions in USD (USDC), to cents; decimal string, null when unavailable"},"initialMarginHeadroomUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Initial margin balance centred on zero, in USD: a new position is accepted only if it stays above zero after its own requirement and fees. Null for the fallback subaccount; decimal string, null when unavailable"},"maintenanceMarginHeadroomUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Maintenance margin balance centred on zero, in USD: below zero the subaccount can be liquidated. Null for the fallback subaccount; decimal string, null when unavailable"},"collaterals":{"type":"array","items":{"type":"object","properties":{"asset":{"type":"string","description":"Derive asset name"},"amount":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Amount in the asset, exact; negative for a borrow; decimal string, null when unavailable"},"borrowed":{"description":"Present on a borrow (negative amount): it pays interest in its own subaccount","type":"boolean","const":true},"priceUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Mark price in USD (USDC), to 8 decimals; decimal string, null when unavailable"},"valueUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"amount × priceUsd in USD, to cents; decimal string, null when unavailable"},"pendingInterest":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Interest accrued in the asset and not yet added to the amount; negative (owed) on a borrow; decimal string, null when unavailable"}},"required":["asset","amount","priceUsd","valueUsd","pendingInterest"],"additionalProperties":false},"description":"Nonzero collateral rows; spot holdings are collateral too"},"openPositions":{"description":"Count of open perpetual and option positions; their unsettled value is part of equityUsd","type":"number"}},"required":["subaccountId","riskUniverse","marginType","equityUsd","initialMarginHeadroomUsd","maintenanceMarginHeadroomUsd","collaterals"],"additionalProperties":false},"description":"Subaccounts that hold something, lowest ID first"},"emptySubaccounts":{"description":"Subaccounts read that hold nothing (no position, no equity); left out of subaccounts","type":"number"},"unreadSubaccounts":{"description":"Subaccounts whose public margin read failed; totals leave them out","type":"array","items":{"type":"object","properties":{"subaccountId":{"type":"number","description":"Derive subaccount ID"},"error":{"type":"string","description":"Why its read failed"}},"required":["subaccountId","error"],"additionalProperties":false}},"notRead":{"description":"Subaccounts beyond the first 50 by ID, which were not read","type":"string"},"riskUniverseError":{"description":"Why the risk universe names are unavailable","type":"string"}},"required":["wallet","totalEquityUsd","assets","subaccounts"],"additionalProperties":false}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getPerpPositions","description":"Get the open Derive perpetual positions of the wallet given as userAddress, per subaccount: side, size, entry and mark price, notional, unrealized PnL, pending funding, leverage and liquidation price, with each subaccount's equity and margin headroom. Public data read by the module; nothing to sign.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."}},"required":["userAddress"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"wallet":{"type":"string","description":"Checksummed wallet address whose Derive account was read"},"positionCount":{"type":"number","description":"Open perpetual positions over the subaccounts read"},"subaccounts":{"type":"array","items":{"type":"object","properties":{"subaccountId":{"type":"number","description":"Derive subaccount ID"},"riskUniverse":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Name of the risk universe whose markets the subaccount trades; null when the names could not be read"},"marginType":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SM (standard) or PM2 (portfolio) margin"},"idle":{"description":"Marks the fallback subaccount: a holding area whose funds cannot trade and count as no margin until moved to a trading subaccount","type":"boolean","const":true},"equityUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Mark value of the collateral and positions in USD (USDC), to cents; decimal string, null when unavailable"},"initialMarginHeadroomUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Initial margin balance centred on zero, in USD: a new position is accepted only if it stays above zero after its own requirement and fees. Null for the fallback subaccount; decimal string, null when unavailable"},"maintenanceMarginHeadroomUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Maintenance margin balance centred on zero, in USD: below zero the subaccount can be liquidated. Null for the fallback subaccount; decimal string, null when unavailable"},"positions":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string","description":"Perpetual market name, e.g. ETH-PERP"},"side":{"type":"string","enum":["long","short"],"description":"Position side"},"size":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Position size in the base asset, without sign; decimal string, null when unavailable"},"entryPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Average entry price, to 8 decimals; decimal string, null when unavailable"},"markPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Mark price, to 8 decimals; decimal string, null when unavailable"},"notionalUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"size × markPrice in USD, to cents (calculated); decimal string, null when unavailable"},"unrealizedPnlUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Unrealized PnL in USD excluding funding, to cents; decimal string, null when unavailable"},"pendingFundingUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Funding accrued but not yet settled, in USD; negative when the position pays; decimal string, null when unavailable"},"leverage":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Leverage Derive reports, to 4 decimals; null when it reports none (often under portfolio margin); decimal string, null when unavailable"},"liquidationPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Liquidation price, to 8 decimals; null when Derive reports none (under standard margin: none near the market); decimal string, null when unavailable"}},"required":["market","side","size","entryPrice","markPrice","notionalUsd","unrealizedPnlUsd","pendingFundingUsd","leverage","liquidationPrice"],"additionalProperties":false},"description":"Open perpetual positions"},"otherPositions":{"description":"Open positions outside the perpetual markets (options); see getOptionPositions","type":"number"}},"required":["subaccountId","riskUniverse","marginType","equityUsd","initialMarginHeadroomUsd","maintenanceMarginHeadroomUsd","positions"],"additionalProperties":false},"description":"Subaccounts that hold something, lowest ID first"},"emptySubaccounts":{"description":"Subaccounts read that hold nothing (no position, no equity); left out of subaccounts","type":"number"},"unreadSubaccounts":{"description":"Subaccounts whose public margin read failed; totals leave them out","type":"array","items":{"type":"object","properties":{"subaccountId":{"type":"number","description":"Derive subaccount ID"},"error":{"type":"string","description":"Why its read failed"}},"required":["subaccountId","error"],"additionalProperties":false}},"notRead":{"description":"Subaccounts beyond the first 50 by ID, which were not read","type":"string"},"riskUniverseError":{"description":"Why the risk universe names are unavailable","type":"string"}},"required":["wallet","positionCount","subaccounts"],"additionalProperties":false}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getOptionPositions","description":"Get the current Derive option holdings of the wallet given as userAddress, per personal subaccount. Show series, size/side, averagePremiumExclFees, markPremium, markValue, unrealizedPnlExclFees, separate totalFees, expiryUtc and valuationAtUtc. Label cost/PnL excluding fees to match Derive’s positions table. Fee-inclusive details and Greeks are available when requested. Premiums are per unit in quoteCurrency; PnL and fees are in USD. Show dates in UTC and identify unread subaccounts. Public data read by the module; nothing to sign.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"One owned non-vault Derive subaccount ID, or null for all personal subaccounts within the read limit."}},"required":["userAddress","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"wallet":{"type":"string","description":"Checksummed wallet address whose Derive account was read"},"subaccountId":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The subaccount requested, or null for all personal subaccounts"},"positionCount":{"type":"number","description":"Option holdings over the subaccounts read successfully"},"subaccounts":{"type":"array","items":{"type":"object","properties":{"subaccountId":{"type":"number","description":"Derive subaccount ID"},"riskUniverseId":{"type":"number","description":"Risk universe ID of the subaccount"},"marginType":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SM (standard) or PM2 (portfolio) margin"},"valuationAtUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time of the margin snapshot the values come from, ISO 8601 UTC"},"positions":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string","description":"Exact Derive option instrument name, including any risk universe suffix"},"underlying":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Underlying asset; null when the series metadata is unavailable"},"optionType":{"anyOf":[{"type":"string","enum":["call","put"]},{"type":"null"}],"description":"Call or put; null when the series metadata is unavailable"},"strike":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Strike price as a decimal string; null when unavailable"},"expiryUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Contract expiry, ISO 8601 UTC; null when unavailable"},"tradingEndsAtUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Trading cutoff of the series, ISO 8601 UTC; null when unavailable"},"quoteCurrency":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Currency of the premiums; null when unavailable"},"baseAssetAddress":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Protocol asset address of the series; null when unavailable"},"baseAssetSubId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Protocol asset sub ID of the series, decimal string; null when unavailable"},"metadataError":{"description":"Why the series terms are unavailable; the holding stays visible","type":"string"},"side":{"type":"string","enum":["long","short"],"description":"Holding side"},"signedAmount":{"type":"string","description":"Exact signed quantity in option units: positive long, negative short"},"size":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Quantity without sign; decimal string, null when unavailable"},"averagePremium":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Average premium per unit including fees, in quoteCurrency; decimal string, null when unavailable"},"averagePremiumExclFees":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Average premium per unit excluding fees (average cost), in quoteCurrency; decimal string, null when unavailable"},"markPremium":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Mark premium per unit, in quoteCurrency; decimal string, null when unavailable"},"indexPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Underlying index price; decimal string, null when unavailable"},"markValue":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Mark value of the whole holding (signed); decimal string, null when unavailable"},"realizedPnl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Realized PnL including fees, in USD; decimal string, null when unavailable"},"realizedPnlExclFees":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Realized PnL excluding fees, in USD; decimal string, null when unavailable"},"unrealizedPnl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Unrealized PnL including fees, in USD; decimal string, null when unavailable"},"unrealizedPnlExclFees":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Unrealized PnL excluding fees, in USD; decimal string, null when unavailable"},"pnlCurrency":{"type":"string","description":"Currency of the four PnL fields: USD, never the premium's quoteCurrency"},"totalFees":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Total fees paid on the holding, in USD; decimal string, null when unavailable"},"feeCurrency":{"type":"string","description":"Currency of totalFees: USD"},"openedAtUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the position was opened, ISO 8601 UTC; null when unavailable"},"perUnitGreeks":{"type":"object","properties":{"delta":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Delta; decimal string, null when unavailable"},"gamma":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gamma; decimal string, null when unavailable"},"vega":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Vega; decimal string, null when unavailable"},"theta":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Theta; decimal string, null when unavailable"}},"required":["delta","gamma","vega","theta"],"additionalProperties":false,"description":"Greeks of one unit of the series"},"positionGreeks":{"type":"object","properties":{"delta":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Delta; decimal string, null when unavailable"},"gamma":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Gamma; decimal string, null when unavailable"},"vega":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Vega; decimal string, null when unavailable"},"theta":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Theta; decimal string, null when unavailable"}},"required":["delta","gamma","vega","theta"],"additionalProperties":false,"description":"Greeks of the whole holding: perUnitGreeks × signedAmount"}},"required":["market","underlying","optionType","strike","expiryUtc","tradingEndsAtUtc","quoteCurrency","baseAssetAddress","baseAssetSubId","side","signedAmount","size","averagePremium","averagePremiumExclFees","markPremium","indexPrice","markValue","realizedPnl","realizedPnlExclFees","unrealizedPnl","unrealizedPnlExclFees","pnlCurrency","totalFees","feeCurrency","openedAtUtc","perUnitGreeks","positionGreeks"],"additionalProperties":false},"description":"Nonzero option holdings"}},"required":["subaccountId","riskUniverseId","marginType","valuationAtUtc","positions"],"additionalProperties":false},"description":"Personal subaccounts read, lowest ID first"},"notRead":{"description":"Subaccounts beyond the first 50 by ID, which were not read","type":"string"},"unreadSubaccounts":{"description":"Subaccounts whose public margin read failed; totals leave them out","type":"array","items":{"type":"object","properties":{"subaccountId":{"type":"number","description":"Derive subaccount ID"},"error":{"type":"string","description":"Why its read failed"}},"required":["subaccountId","error"],"additionalProperties":false}}},"required":["wallet","subaccountId","positionCount","subaccounts"],"additionalProperties":false}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getSupportedAssets","description":"Get the perpetual futures or spot markets Derive lists, with each market risk universe, order size limits, tick size, fees and, for perpetuals, maximum leverage and supported margin types. For perpetuals, minAmount is the resting-limit minimum and minMarketAmount the market-order minimum. Also returns upcoming listings and planned delistings; show their activatesAtUtc and delistsAtUtc dates with the UTC timezone. Show at most 10 markets unless the user requests more or all markets. Public market data: no wallet is needed.","inputSchema":{"type":"object","properties":{"marketType":{"type":"string","enum":["futures","spot"],"description":"Select spot or perpetual futures."}},"required":["marketType"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"marketType":{"type":"string","enum":["futures","spot"],"description":"Select spot or perpetual futures."},"count":{"type":"number","description":"Number of live markets listed"},"markets":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string","description":"Exact Derive market (instrument) name, e.g. \"BTC-PERP\" or \"ETH-USDC\""},"baseAsset":{"type":"string","description":"Base asset symbol"},"quoteAsset":{"type":"string","description":"Quote asset symbol"},"riskUniverse":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Name of the risk universe the market belongs to; null when the universe is unknown"},"riskUniverseId":{"type":"number","description":"Risk universe id; a subaccount trades only the markets of its own universe"},"tickSize":{"type":"string","description":"Price tick in the quote asset"},"minAmount":{"type":"string","description":"Minimum order amount in the base asset; for a perpetual, the resting-limit minimum"},"maxAmount":{"type":"string","description":"Maximum order amount in the base asset"},"amountStep":{"type":"string","description":"Order amount step in the base asset"},"makerFeePct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Maker fee as a percentage of notional; null when not published"},"takerFeePct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Taker fee as a percentage of notional; null when not published"},"takerBaseFeeUsd":{"type":"string","description":"Fixed USD fee a taker also pays per order"},"minMarketAmount":{"description":"Perpetuals only: market-order minimum in the base asset (the amount step)","type":"string"},"priceIndex":{"description":"Perpetuals only: the price index the perpetual tracks","type":"string"},"maxLeverage":{"description":"Perpetuals only: standard-margin maximum leverage; null when not published","anyOf":[{"type":"string"},{"type":"null"}]},"marginTypes":{"description":"Perpetuals only: margin types whose manager supports the market (SM standard, PM2 portfolio); null when the risk universe is unknown","anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"delistsAtUtc":{"description":"Planned delisting time, \"YYYY-MM-DD HH:MM UTC\"; present only when one is scheduled","type":"string"}},"required":["market","baseAsset","quoteAsset","riskUniverse","riskUniverseId","tickSize","minAmount","maxAmount","amountStep","makerFeePct","takerFeePct","takerBaseFeeUsd"],"additionalProperties":false},"description":"Live markets, sorted by name"},"upcoming":{"description":"Markets scheduled to list later; present only when there are some","type":"array","items":{"type":"object","properties":{"market":{"type":"string"},"activatesAtUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Scheduled listing time, \"YYYY-MM-DD HH:MM UTC\"; null when unknown"}},"required":["market","activatesAtUtc"],"additionalProperties":false}}},"required":["marketType","count","markets"],"additionalProperties":false}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getOptionChain","description":"Discover active Derive option expiries for an underlying, or list the option series for one expiry. Show UTC dates, exact instrument names, premiums, available bid/ask sizes, implied volatility percentages and Greeks. A null book side is unavailable; mark is a valuation. Follow nextPage for more results. Public market data: no wallet is needed.","inputSchema":{"type":"object","properties":{"underlying":{"type":"string","description":"Underlying currency symbol, e.g. ETH, BTC or SOL."},"expiry":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"UTC expiry date (YYYY-MM-DD or YYYYMMDD). Null lists expiries and their call/put counts."},"optionType":{"anyOf":[{"type":"string","enum":["call","put"]},{"type":"null"}],"description":"For a chosen expiry, select calls or puts. Null for both."},"minStrike":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inclusive minimum strike as a positive decimal string for a chosen expiry. Null for no lower bound."},"maxStrike":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inclusive maximum strike as a positive decimal string for a chosen expiry. Set equal to minStrike for one strike. Null for no upper bound."},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Page of matching expiries or series, starting at 1. Null selects the first page."},"pageSize":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Expiries or individual series per page, 1 to 100. Null selects 20."}},"required":["underlying","expiry","optionType","minStrike","maxStrike","page","pageSize"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","const":"expiries"},"underlying":{"type":"string","description":"Underlying currency symbol, upper-cased"},"page":{"type":"number","description":"This page, starting at 1"},"pageSize":{"type":"number","description":"Entries per page"},"total":{"type":"number","description":"Matching entries across all pages"},"nextPage":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Next page to request with the same filters; null on the last page"},"expiry":{"type":"null"},"expiries":{"type":"array","items":{"type":"object","properties":{"expiry":{"type":"string","description":"Expiry date YYYY-MM-DD, to pass as expiry"},"expiryUtc":{"type":"string","description":"Exact expiry time, ISO 8601 UTC"},"calls":{"type":"number","description":"Active call series"},"puts":{"type":"number","description":"Active put series"}},"required":["expiry","expiryUtc","calls","puts"],"additionalProperties":false},"description":"Active expiries, earliest first"}},"required":["mode","underlying","page","pageSize","total","nextPage","expiry","expiries"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","const":"chain"},"underlying":{"type":"string","description":"Underlying currency symbol, upper-cased"},"page":{"type":"number","description":"This page, starting at 1"},"pageSize":{"type":"number","description":"Entries per page"},"total":{"type":"number","description":"Matching entries across all pages"},"nextPage":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Next page to request with the same filters; null on the last page"},"expiry":{"type":"string","description":"The chosen expiry date, YYYY-MM-DD"},"tickerError":{"description":"Why the quotes could not be read; the series are then listed without quotes","type":"string"},"series":{"type":"array","items":{"type":"object","properties":{"market":{"type":"string","description":"Exact Derive option instrument name, including any risk universe suffix"},"optionType":{"type":"string","enum":["call","put"]},"strike":{"type":"string","description":"Strike price in the quote currency"},"expiryUtc":{"type":"string","description":"Option expiry, ISO 8601 UTC"},"tradingEndsAtUtc":{"type":"string","description":"Trading cutoff (the earlier of expiry and delisting), ISO 8601 UTC"},"quoteCurrency":{"type":"string","description":"Currency of strikes and premiums"},"riskUniverseId":{"type":"number","description":"Risk universe id of the series"},"baseAssetAddress":{"type":"string","description":"Protocol asset address an order signs for the series"},"baseAssetSubId":{"type":"string","description":"Protocol asset sub id, a decimal string"},"tickSize":{"type":"string","description":"Premium tick"},"amountStep":{"type":"string","description":"Order size step in option units"},"minAmount":{"type":"string","description":"Minimum order size in option units"},"maxAmount":{"type":"string","description":"Maximum order size in option units"},"quoteAvailable":{"type":"boolean","description":"False when the ticker is missing or invalid; the market fields are then null"},"updatedAtUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Ticker time, ISO 8601 UTC; null without a quote"},"bestBid":{"anyOf":[{"type":"object","properties":{"price":{"type":"string","description":"Price in human-readable decimal format (e.g. '1.5'), in the quote asset (a premium per unit for an option)"},"amount":{"type":"string","description":"Amount available at that price in human-readable decimal format (e.g. '1.5'), in the base asset (option units for an option)"}},"required":["price","amount"],"additionalProperties":false},{"type":"null"}],"description":"Best bid premium per unit and its available size; null when that side of the book is empty"},"bestAsk":{"anyOf":[{"type":"object","properties":{"price":{"type":"string","description":"Price in human-readable decimal format (e.g. '1.5'), in the quote asset (a premium per unit for an option)"},"amount":{"type":"string","description":"Amount available at that price in human-readable decimal format (e.g. '1.5'), in the base asset (option units for an option)"}},"required":["price","amount"],"additionalProperties":false},{"type":"null"}],"description":"Best ask premium per unit and its available size; null when that side of the book is empty"},"markPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Mark premium per unit in quoteCurrency, a model valuation; null when not published"},"indexPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Underlying index price; null when not published"},"markIvPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Mark implied volatility in percent; null when not published"},"bidIvPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bid implied volatility in percent; null without a bid"},"askIvPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Ask implied volatility in percent; null without an ask"},"greeks":{"anyOf":[{"type":"object","properties":{"delta":{"anyOf":[{"type":"string"},{"type":"null"}]},"gamma":{"anyOf":[{"type":"string"},{"type":"null"}]},"theta":{"anyOf":[{"type":"string"},{"type":"null"}]},"vega":{"anyOf":[{"type":"string"},{"type":"null"}]},"rho":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["delta","gamma","theta","vega","rho"],"additionalProperties":false},{"type":"null"}],"description":"Greeks in Derive's units; null without model pricing"},"openInterest":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Open interest in option units; null when not published"}},"required":["market","optionType","strike","expiryUtc","tradingEndsAtUtc","quoteCurrency","riskUniverseId","baseAssetAddress","baseAssetSubId","tickSize","amountStep","minAmount","maxAmount","quoteAvailable","updatedAtUtc","bestBid","bestAsk","markPrice","indexPrice","markIvPct","bidIvPct","askIvPct","greeks","openInterest"],"additionalProperties":false},"description":"Series by increasing strike, calls before puts"}},"required":["mode","underlying","page","pageSize","total","nextPage","expiry","series"],"additionalProperties":false}]}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getMarketData","description":"Get Derive perpetual futures or spot market data for the given assets: mark and index price, best bid and ask, 24h change, high, low and volume, and for perpetuals open interest, hourly funding rate and maximum leverage. Show updatedAtUtc with the UTC timezone. Public market data: no wallet is needed.","inputSchema":{"type":"object","properties":{"marketType":{"type":"string","enum":["futures","spot"],"description":"Select spot or perpetual futures."},"assets":{"type":"array","items":{"type":"string"},"description":"1 to 20 asset symbols or market names, e.g. [\"BTC\", \"ETH\"] or [\"ETH-USDC\"]."}},"required":["marketType","assets"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"marketType":{"type":"string","enum":["futures","spot"],"description":"Select spot or perpetual futures."},"markets":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"market":{"type":"string","description":"Exact Derive market (instrument) name, e.g. \"BTC-PERP\" or \"ETH-USDC\""},"baseAsset":{"type":"string","description":"Base asset symbol"},"quoteAsset":{"type":"string","description":"Quote asset symbol"},"markPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Mark price in the quote asset; null when not published"},"indexPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Index price in the quote asset; null when not published"},"bestBid":{"anyOf":[{"type":"object","properties":{"price":{"type":"string","description":"Price in human-readable decimal format (e.g. '1.5'), in the quote asset (a premium per unit for an option)"},"amount":{"type":"string","description":"Amount available at that price in human-readable decimal format (e.g. '1.5'), in the base asset (option units for an option)"}},"required":["price","amount"],"additionalProperties":false},{"type":"null"}],"description":"Best bid; null when that side of the book is empty"},"bestAsk":{"anyOf":[{"type":"object","properties":{"price":{"type":"string","description":"Price in human-readable decimal format (e.g. '1.5'), in the quote asset (a premium per unit for an option)"},"amount":{"type":"string","description":"Amount available at that price in human-readable decimal format (e.g. '1.5'), in the base asset (option units for an option)"}},"required":["price","amount"],"additionalProperties":false},{"type":"null"}],"description":"Best ask; null when that side of the book is empty"},"change24hPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Percentage change from the first to the last trade of the last 24 hours; null when nothing traded or the candles were unavailable"},"high24h":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Highest trade price of the last 24 hours; null when nothing traded or the candles were unavailable"},"low24h":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lowest trade price of the last 24 hours; null when nothing traded or the candles were unavailable"},"volume24hBase":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"24h traded amount in the base asset; null when not published"},"volume24hUsd":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"24h traded notional in USD; null when not published"},"trades24h":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Number of trades in the last 24 hours; null when not published"},"openInterest":{"description":"Perpetuals only: open interest in the base asset; null when not published","anyOf":[{"type":"string"},{"type":"null"}]},"fundingRateHourlyPct":{"description":"Perpetuals only: current hourly funding rate in percent; null when not published","anyOf":[{"type":"string"},{"type":"null"}]},"maxLeverage":{"description":"Perpetuals only: standard-margin maximum leverage; null when not published","anyOf":[{"type":"string"},{"type":"null"}]},"updatedAtUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Ticker time, \"YYYY-MM-DD HH:MM UTC\"; null when unknown"}},"required":["market","baseAsset","quoteAsset","markPrice","indexPrice","bestBid","bestAsk","change24hPct","high24h","low24h","volume24hBase","volume24hUsd","trades24h","updatedAtUtc"],"additionalProperties":false},{"type":"object","properties":{"market":{"type":"string","description":"Exact Derive market (instrument) name, e.g. \"BTC-PERP\" or \"ETH-USDC\""},"baseAsset":{"type":"string","description":"Base asset symbol"},"quoteAsset":{"type":"string","description":"Quote asset symbol"},"available":{"type":"boolean","const":false},"reason":{"type":"string","description":"Why the market has no data, e.g. Derive publishes no ticker for it right now"}},"required":["market","baseAsset","quoteAsset","available","reason"],"additionalProperties":false}]},"description":"One entry per requested market"},"notFound":{"description":"Requested names that match no listed market","type":"array","items":{"type":"string"}},"listed":{"description":"Base assets of the listed markets, when some names were not found","type":"string"},"tradeStatsError":{"description":"Markets whose 24h high, low and change could not be read","type":"string"}},"required":["marketType","markets"],"additionalProperties":false}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getFundingRates","description":"Get current Derive perpetual funding rates (per hour, with the annualized equivalent and who pays) for the given assets, or for all perpetuals when assets is empty. Show updatedAtUtc with the UTC timezone. Public market data: no wallet is needed.","inputSchema":{"type":"object","properties":{"assets":{"type":"array","items":{"type":"string"},"description":"Up to 20 asset symbols or perpetual market names, e.g. [\"BTC\", \"ETH\"]. Pass an empty array for all perpetuals."}},"required":["assets"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"count":{"type":"number","description":"Number of perpetuals in rates"},"rates":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"market":{"type":"string","description":"Exact Derive market (instrument) name, e.g. \"BTC-PERP\" or \"ETH-USDC\""},"baseAsset":{"type":"string","description":"Base asset symbol"},"quoteAsset":{"type":"string","description":"Quote asset symbol"},"fundingRateHourlyPct":{"type":"string","description":"Current hourly funding rate in percent; positive means longs pay shorts"},"fundingRateAnnualizedPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The hourly rate × 8760 (simple, not compounded), a calculated estimate"},"payer":{"type":"string","enum":["longs pay shorts","shorts pay longs","no funding"],"description":"Who pays funding at the current rate"},"updatedAtUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Ticker time, \"YYYY-MM-DD HH:MM UTC\"; null when unknown"}},"required":["market","baseAsset","quoteAsset","fundingRateHourlyPct","fundingRateAnnualizedPct","payer","updatedAtUtc"],"additionalProperties":false},{"type":"object","properties":{"market":{"type":"string","description":"Exact Derive market (instrument) name, e.g. \"BTC-PERP\" or \"ETH-USDC\""},"baseAsset":{"type":"string","description":"Base asset symbol"},"quoteAsset":{"type":"string","description":"Quote asset symbol"},"available":{"type":"boolean","const":false},"reason":{"type":"string","description":"Why the market has no rate, e.g. Derive publishes no funding rate for it right now"}},"required":["market","baseAsset","quoteAsset","available","reason"],"additionalProperties":false}]}},"notFound":{"description":"Requested names that match no listed perpetual","type":"array","items":{"type":"string"}},"listed":{"description":"Base assets of the listed perpetuals, when some names were not found","type":"string"}},"required":["count","rates"],"additionalProperties":false}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getHistoricalFundingRates","description":"Get past hourly funding rates of Derive perpetuals over time ranges ending now, with each range time-weighted average (also annualized), minimum, maximum, latest rate and a compact series. Show dates with their UTC fields. Public market data: no wallet is needed.","inputSchema":{"type":"object","properties":{"assetsWithTimeRanges":{"type":"array","items":{"type":"object","properties":{"asset":{"type":"string","description":"Asset symbol or perpetual market name, e.g. \"BTC\" or \"ETH-PERP\"."},"timeRanges":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":"Up to 5 ranges as \"<number><unit>\" with unit h (1h), d (24h), w (168h), m (720h), from 1h up to 200 days, e.g. \"24h\", \"7d\", \"1m\". null means 24h."}},"required":["asset","timeRanges"],"additionalProperties":false},"description":"1 to 20 perpetual assets with their time ranges."}},"required":["assetsWithTimeRanges"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"results":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"asset":{"type":"string","description":"The requested asset, upper-cased"},"market":{"type":"string","description":"The perpetual it names"},"ranges":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"range":{"type":"string","description":"The time range as requested, normalized, e.g. \"24h\" or \"7d\""},"fromUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start, \"YYYY-MM-DD HH:MM UTC\"; null when unknown"},"toUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (now), \"YYYY-MM-DD HH:MM UTC\"; null when unknown"},"dataFromUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Where known funding data starts inside the window, \"YYYY-MM-DD HH:MM UTC\"; null when unknown"},"partial":{"type":"boolean","description":"True when Derive's history starts after the window's start"},"sampleMinutes":{"type":"number","description":"Period in minutes of the funding candles the window is averaged from"},"averageHourlyPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time-weighted average hourly rate in percent"},"averageAnnualizedPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"That average annualized (× 8760, simple), a calculated estimate"},"minHourlyPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Lowest hourly rate in percent, including candle lows"},"maxHourlyPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Highest hourly rate in percent, including candle highs"},"latestHourlyPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Current hourly rate in percent"},"pointIntervalHours":{"type":"number","description":"Length in hours of each point bucket"},"points":{"type":"array","items":{"type":"object","properties":{"atUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Bucket start, \"YYYY-MM-DD HH:MM UTC\"; null when unknown"},"hourlyPct":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Time-weighted average hourly rate in percent over the bucket; null when no data"}},"required":["atUtc","hourlyPct"],"additionalProperties":false},"description":"Consecutive buckets ending now, oldest first (the oldest may be shorter); at most 48"}},"required":["range","fromUtc","toUtc","dataFromUtc","partial","sampleMinutes","averageHourlyPct","averageAnnualizedPct","minHourlyPct","maxHourlyPct","latestHourlyPct","pointIntervalHours","points"],"additionalProperties":false},{"type":"object","properties":{"range":{"type":"string","description":"The time range"},"fromUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start, \"YYYY-MM-DD HH:MM UTC\"; null when unknown"},"toUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (now), \"YYYY-MM-DD HH:MM UTC\"; null when unknown"},"available":{"type":"boolean","const":false},"reason":{"type":"string","description":"Why there is no summary, e.g. Derive has no funding history in this window"}},"required":["range","fromUtc","toUtc","available","reason"],"additionalProperties":false},{"type":"object","properties":{"range":{"type":"string","description":"The time range"},"error":{"type":"string","description":"Why the history of this range could not be read"}},"required":["range","error"],"additionalProperties":false}]},"description":"One summary per distinct range of the market"}},"required":["asset","market","ranges"],"additionalProperties":false},{"type":"object","properties":{"asset":{"type":"string","description":"The requested asset, upper-cased"},"market":{"description":"The perpetual it names; absent when it names none","type":"string"},"error":{"type":"string","description":"Why nothing could be read for this asset"}},"required":["asset","error"],"additionalProperties":false}]},"description":"One result per distinct perpetual requested, then one per unknown asset"}},"required":["results"],"additionalProperties":false}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getDeposits","description":"Read the Derive deposits of the userAddress wallet. The public tracker covers the bridge and Ethereum deposit stages, including a first deposit, and comes back in data, newest first. Private history reports applied deposits, fees, fallback credits and batch status: it comes back as an unsigned Derive API request in apiRequestActions, which the wallet completes with its login and sends; the note says how, and how to merge its rows with the pending ones (dedupe, asset filter, newest first, limit). A confirmed tracker entry alone does not prove credit. Show timestamps in UTC and report any unavailable source.","inputSchema":{"type":"object","properties":{"view":{"anyOf":[{"type":"string","enum":["all","pending","settled"]},{"type":"null"}],"description":"Use pending for the public tracker, settled for applied history, or null/all for both."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owned subaccount to check, or null for the whole wallet including first deposits to a new subaccount."},"asset":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Derive asset symbol such as USDC or ETH, or its Ethereum token or protocol asset address. Null for all assets."},"fromUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inclusive start of the UTC time window, e.g. 2026-10-01T00:00:00Z. Null to omit."},"toUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inclusive end of the UTC time window, e.g. 2026-10-31T23:59:59.999Z. Null to omit."},"limit":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}],"description":"Maximum matching deposits to return, from 1 to 100. Null selects 20."},"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."}},"required":["view","subaccountId","asset","fromUtc","toUtc","limit","userAddress"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"wallet":{"type":"string","description":"The wallet read"},"view":{"type":"string","enum":["all","pending","settled"],"description":"The sources asked for"},"subaccountId":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The subaccount filter, or null for the whole wallet"},"depositCount":{"type":"number","description":"Number of pending deposits returned"},"deposits":{"type":"array","items":{"type":"object","properties":{"stage":{"type":"string","const":"pending","description":"Always \"pending\": a public tracker observation, not an applied credit"},"status":{"type":"string","description":"Tracker status: bridging, detected, pending, confirmed or reverted"},"asset":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Derive asset symbol; null when it could not be identified"},"assetAddress":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Derive protocol asset address"},"tokenAddress":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Ethereum ERC-20 token address"},"amountRaw":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Amount as a raw integer of the token"},"amount":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Amount in human-readable decimal format (e.g. '1.5'), when the token decimals are known"},"amountIsEstimate":{"type":"boolean","description":"True for a bridge amount that is not yet received"},"subaccountId":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Credited subaccount; null for a deposit to a new subaccount"},"newSubaccount":{"type":"boolean","description":"True for a deposit that opens a new subaccount"},"managerId":{"type":"number","description":"Margin manager id of the deposit"},"timestampUtc":{"type":"string","description":"Observation time, ISO UTC"},"updatedAtUtc":{"type":"string","description":"Last tracker update, ISO UTC"},"actionId":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Derive action id; matches action_id of the applied history"},"actionType":{"type":"string","description":"Deposit or DepositToNewSubaccount"},"depositType":{"type":"string","description":"standard or direct"},"logIndex":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Log index of the Ethereum deposit event"},"l1Tx":{"anyOf":[{"type":"object","properties":{"hash":{"type":"string","description":"Transaction hash"},"txLink":{"type":"string","description":"Block-explorer link of the transaction"}},"required":["hash","txLink"],"additionalProperties":false},{"type":"null"}],"description":"Ethereum deposit transaction"},"bridge":{"anyOf":[{"type":"object","properties":{"rail":{"type":"string","description":"Bridge rail"},"sourceChainId":{"type":"number","description":"Chain id the deposit was bridged from"},"sourceTx":{"description":"Source-chain transaction, when its explorer is known","type":"object","properties":{"hash":{"type":"string","description":"Transaction hash"},"txLink":{"type":"string","description":"Block-explorer link of the transaction"}},"required":["hash","txLink"],"additionalProperties":false},"bridgeId":{"type":"string","description":"Derive's bridge tracking id"},"providerTransferId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The bridge provider's transfer id, when given"},"status":{"type":"string","description":"Bridge status"},"substatus":{"description":"Bridge substatus","type":"string"},"receivingTx":{"description":"Ethereum transaction that received the bridged token","type":"object","properties":{"hash":{"type":"string","description":"Transaction hash"},"txLink":{"type":"string","description":"Block-explorer link of the transaction"}},"required":["hash","txLink"],"additionalProperties":false},"expectedToken":{"description":"Token expected from the bridge","type":"string"},"receivingToken":{"description":"Token received from the bridge","type":"string"},"expectedAmountRaw":{"description":"Expected amount as a raw integer of the token","type":"string"},"receivingAmountRaw":{"description":"Received amount as a raw integer of the token","type":"string"},"expiresAtUtc":{"description":"When the bridge quote expires, ISO UTC","type":"string"},"deliveredAtUtc":{"description":"When the bridge delivered, ISO UTC","type":"string"}},"required":["rail","sourceChainId","bridgeId","providerTransferId","status"],"additionalProperties":false},{"type":"null"}],"description":"Bridge stage of a bridged deposit; null for a direct Ethereum deposit"}},"required":["stage","status","asset","assetAddress","tokenAddress","amountRaw","amount","amountIsEstimate","subaccountId","newSubaccount","managerId","timestampUtc","updatedAtUtc","actionId","actionType","depositType","logIndex","l1Tx","bridge"],"additionalProperties":false},"description":"Pending tracker observations, newest first; empty for view \"settled\""},"hasMore":{"type":"boolean","description":"True when more pending deposits matched than limit"},"unresolvedAssetCount":{"description":"Pending rows whose asset could not be identified for the asset filter","type":"number"},"sourceErrors":{"description":"Sources that could not be read; their deposits are unknown","type":"object","properties":{"pending":{"description":"Why the public tracker could not be read","type":"string"},"settled":{"description":"Why the applied-history request could not be built","type":"string"}},"additionalProperties":false}},"required":["wallet","view","subaccountId","depositCount","deposits","hasMore"],"additionalProperties":false},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","data","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getWithdrawals","description":"Read the Derive withdrawals of the userAddress wallet: returns an unsigned private Derive API request (apiRequestActions) that the wallet completes with its login and sends; its answer is Derive's raw list for the wallet or subaccount and UTC window (at most 1000 rows), and the note says which asset filter, deduplication, newest-first sort and limit to apply to it. Show the amount, fee, net amount, Ethereum recipient and UTC timestamp. Report destination delivery status separately from Ethereum settlement. Label amount_forwarded as sent. If asked how much arrived, say the exact received amount is unknown, even when delivery is confirmed.","inputSchema":{"type":"object","properties":{"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owned Derive subaccount, or null for the whole wallet."},"asset":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Derive asset symbol, such as ETH or USDC, or the settlement token’s Ethereum address. Null for all assets."},"fromUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inclusive start in UTC, e.g. 2026-10-01T00:00:00Z. Null to omit."},"toUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inclusive end in UTC, e.g. 2026-10-31T23:59:59.999Z. Null to omit."},"limit":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}],"description":"Return up to this many matching withdrawals (1 to 100). Null selects 20."},"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."}},"required":["subaccountId","asset","fromUtc","toUtc","limit","userAddress"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getTransfers","description":"Read settled Derive spot transfers for the userAddress wallet or one owned subaccount: returns an unsigned private Derive API request (apiRequestActions) that the wallet completes with its login and sends; its answer is Derive's raw list for the wallet or subaccount and UTC window (at most 1000 rows), and the note says which asset filter, newest-first sort and limit to apply to it. Show the sending and receiving accounts, UTC time and batch status. Outgoing amount includes the fee. Incoming amount is the net credit and the sender’s debit is unknown. Treat both sides of an internal transfer with the same operation_id as one movement.","inputSchema":{"type":"object","properties":{"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owned Derive subaccount, or null for the whole wallet."},"asset":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Derive asset symbol, protocol asset address or underlying Ethereum token address. Null for all assets."},"fromUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inclusive start in UTC, e.g. 2026-10-01T00:00:00Z. Null to omit."},"toUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inclusive end in UTC, e.g. 2026-10-31T23:59:59.999Z. Null to omit."},"limit":{"anyOf":[{"type":"integer","minimum":1,"maximum":100},{"type":"null"}],"description":"Return up to this many matching transfer rows (1 to 100). Null selects 20."},"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."}},"required":["subaccountId","asset","fromUtc","toUtc","limit","userAddress"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"depositToDerive","description":"Deposit a token from the userAddress wallet on ethereum into a Derive subaccount: an existing one, the subaccount of a risk universe or market, or a new one. Returns unsigned ethereum transactions to send in order: a wrap of native ETH when asked, an approval when needed, then the deposit. The destination, the wallet balance, Derive's minimum and cap and the token are checked first, because a wrong deposit is mined anyway and then credited to the fallback subaccount, to a stranger, or nowhere.","inputSchema":{"type":"object","properties":{"chainName":{"type":"string","enum":["ethereum"],"description":"Source network where the deposit transactions are executed."},"asset":{"type":"string","description":"Token to deposit, by the symbol the user names, e.g. \"ETH\", \"USDC\", \"USDT\", \"WETH\" or \"WBTC\"; \"CBBTC\" is cbBTC on ethereum and \"CBBTC_B\" cbBTC bridged from Base. \"ETH\" is native ether, wrapped to WETH before the deposit; \"WETH\" spends the wallet's WETH."},"amount":{"type":"string","description":"Amount in human-readable decimal format (e.g. '1.5'), in token units, e.g. \"100\". Pass \"-1\" to deposit the whole wallet balance of the token; for native ETH a reserve for gas stays in the wallet."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Existing subaccount of the wallet to deposit into, as getBalances lists it; null to choose by market."},"market":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Risk universe (e.g. \"PRIME\") or a market or asset the deposit is for, e.g. \"HYPE\" or \"SOL-PERP\": uses the wallet subaccount there, or creates one. null: the wallet's only trading subaccount, or a new PRIME subaccount when it has none."},"marginType":{"anyOf":[{"type":"string","enum":["SM","PM2"]},{"type":"null"}],"description":"Standard (SM) or portfolio (PM2) margin of the subaccount to use or create; null: SM for a new subaccount."},"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."}},"required":["chainName","asset","amount","subaccountId","market","marginType","userAddress"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"chainId":{"type":"number","description":"EVM chain ID"},"transaction":{"type":"object","properties":{"target":{"type":"string","description":"Target contract address"},"data":{"type":"string","description":"ABI-encoded calldata"},"value":{"description":"Native token value in wei","type":"string"}},"required":["target","data"],"additionalProperties":false,"description":"EVM transaction parameters"}},"required":["chainId","transaction"],"additionalProperties":false},"description":"Unsigned Ethereum transactions to sign and broadcast in order"}},"required":["project","operation","transactions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"withdrawFromDerive","description":"Withdraw an asset from a Derive subaccount to the userAddress wallet. Derive pays it on ethereum later, in its settlement batch, less a fee of up to $1 taken from the amount; ETH is paid as WETH. Derive can instead forward HYPE and KHYPE to hyperevm, CBBTC_B to base, SOL and JITOSOL to solana. Returns unsigned Derive API requests that the wallet completes with its login and an EIP-712 signature of the withdrawal (toSign); a forwarded withdrawal first registers Derive's forward address, and the note says what to check in that answer before sending the withdrawal.","inputSchema":{"type":"object","properties":{"chainName":{"type":"string","enum":["ethereum","hyperevm","base","solana"],"description":"Destination network to receive the asset on. \"ethereum\" pays any supported asset as its Ethereum token; the others forward the assets listed in the tool description. Use the user's chosen network; ask if the destination is unclear."},"asset":{"type":"string","description":"Derive asset to withdraw, as getBalances lists it, e.g. \"USDC\", \"ETH\", \"WBTC\" or \"HYPE\"."},"amount":{"type":"string","description":"Amount in human-readable decimal format (e.g. '1.5'), in asset units, e.g. \"100\". Pass \"-1\" to withdraw the most the subaccount can: what it holds, less what its open positions and orders need as margin."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Subaccount to withdraw from, as getBalances lists it; null for the only subaccount that holds the asset."},"solanaAddress":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The user's own Solana wallet address (base58) to receive the asset when chainName is \"solana\", as the user confirms it. Neither Derive nor this tool checks that the address belongs to the user: funds forwarded to any other address cannot be recovered. null for any other chainName."},"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."}},"required":["chainName","asset","amount","subaccountId","solanaAddress","userAddress"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"transferBetweenSubaccounts","description":"Move an asset between the userAddress wallet's Derive subaccounts, e.g. out of the fallback subaccount or into the subaccount of another risk universe or margin type. Opens a new subaccount when the wallet has none there; Derive takes a fee of up to $1.5 from the amount for that. Returns one unsigned Derive API request (private/transfer_spot) that the wallet completes with its login and an EIP-712 signature of the transfer (toSign).","inputSchema":{"type":"object","properties":{"asset":{"type":"string","description":"Derive asset to move, as getBalances lists it, e.g. \"USDC\", \"ETH\" or \"HYPE\"."},"amount":{"type":"string","description":"Amount in human-readable decimal format (e.g. '1.5'), in asset units, e.g. \"100\". Pass \"-1\" to move the most the source can give up: what it holds, less what its open positions and orders need as margin."},"fromSubaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Subaccount to move from, as getBalances lists it; null for the only subaccount that holds the asset."},"toSubaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Existing subaccount to move into; null to choose by market, or the only other trading subaccount when market is null too."},"market":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Risk universe (e.g. \"PRIME\") or a market or asset the destination is for, e.g. \"HYPE\" or \"SOL-PERP\": uses the wallet subaccount there, or opens one. null with toSubaccountId, or for the only other trading subaccount."},"marginType":{"anyOf":[{"type":"string","enum":["SM","PM2"]},{"type":"null"}],"description":"Standard (SM) or portfolio (PM2) margin of the destination to use or open; null: SM for a new subaccount."},"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."}},"required":["asset","amount","fromSubaccountId","toSubaccountId","market","marginType","userAddress"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getOpenOrders","description":"Get the open Derive orders of the wallet: resting orders, pending trigger orders (take profits, stop losses and trigger entries alike) and running TWAPs. Derive serves this only to a signed-in wallet, so it returns unsigned private read requests for the userAddress wallet to sign in and send (the note says how), and how to read their answers. The note says how to merge the answers, which orders to show for the market type and what their fields mean. Select options explicitly for personal-subaccount option orders: premiums are per option unit, and order-signature expiry differs from option expiry. Describe a trigger order by its side and when it fires, show dates in UTC and identify unread lists.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"marketType":{"anyOf":[{"type":"string","enum":["futures","spot","options"]},{"type":"null"}],"description":"Select spot, perpetual futures, or options. Null returns spot and perpetual orders; use options explicitly to read option orders."}},"required":["userAddress","marketType"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getOrdersById","description":"Look up exact open or completed Derive spot, perpetual or option orders by ID, one private/get_order request per owned reference. Derive serves this only to a signed-in wallet, so it returns unsigned private read requests for the userAddress wallet to sign in and send (the note says how), and how to read their answers. Describe a trigger order by its side and when it fires, not as a take profit or stop loss from its raw type. For options, report per-unit premiums and actual fills; the unfilled amount is not necessarily live. order_fee is the reported fee in USD. Report unread references and show order and option dates separately in UTC.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"orders":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"orderId":{"type":"string","description":"Derive order UUID."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owning Derive subaccount number. Null selects the wallet’s only subaccount. If it has several, use the one that holds the order."}},"required":["orderId","subaccountId"],"additionalProperties":false},"description":"One to 20 exact spot, perpetual or option order references. Use the order_id and subaccount_id from Derive's answer to an order request or getOpenOrders."}},"required":["userAddress","orders"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getMyTrades","description":"Get the wallet’s executed Derive fills across spot, perpetual and option markets, or of one market type: one exchange page of private/get_trade_history with the exchange filters. Derive serves this only to a signed-in wallet, so it returns unsigned private read requests for the userAddress wallet to sign in and send (the note says how), and how to read their answers. Keep the fills the note names for the market type and show each fill’s market. For options, show the premium per unit, the premium total before fees, and the fee and PnL in USD. Each row is one fill, not the whole order or position. Show execution and option dates separately in UTC. Follow the next page with the same filters even when a page has no matching fills.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owned subaccount number, or null for the whole wallet. Option scope uses personal subaccounts."},"marketType":{"anyOf":[{"type":"string","enum":["futures","spot","options"]},{"type":"null"}],"description":"Filter one exchange page to spot, perpetual futures, or options. Null returns the fills of every market type, spot, perpetual and option fills together."},"market":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact Derive instrument, including any risk universe suffix. Use an exact option series with marketType options, or a spot/perpetual name such as ETH-USDC or ETH-PERP. Null for all markets in the selected scope."},"orderId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Derive order UUID, or null for fills from any order."},"fromUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start of the time window in UTC, e.g. 2026-10-01T00:00:00Z. Null to omit."},"toUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End of the time window in UTC, e.g. 2026-10-31T23:59:59.999Z. Reuse the same window across pages. Null to omit."},"page":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Exchange page number, starting at 1. Null for the first page."},"pageSize":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":100},{"type":"null"}],"description":"Exchange records per page, 1 to 100. Null for 20."}},"required":["userAddress","subaccountId","marketType","market","orderId","fromUtc","toUtc","page","pageSize"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getOptionSettlements","description":"Get the wallet’s expired option settlements on Derive: private/get_option_settlement_history returns the whole history of the wallet or subaccount. Derive serves this only to a signed-in wallet, so it returns unsigned private read requests for the userAddress wallet to sign in and send (the note says how), and how to read their answers. Apply the filters, newest-expiry-first order and page the note gives. Show each cash settlement with its currency, or say the currency is unavailable; show both realized PnL fields in USD, preserve null PnL, and show expiry in UTC.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owned non-vault subaccount, or null for all personal subaccounts."},"market":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact option series, including any risk-universe suffix, or null for all series."},"fromUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inclusive option expiry lower bound in UTC, e.g. 2026-10-01T00:00:00Z. Null to omit."},"toUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Inclusive option expiry upper bound in UTC. This filters expiry, not settlement processing time. Reuse the same bounds across pages. Null to omit."},"page":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Page of matching settlements, starting at 1, applied to the answer as the note says. Null for the first page."},"pageSize":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":100},{"type":"null"}],"description":"Matching settlements per page, 1 to 100. Null for 20."}},"required":["userAddress","subaccountId","market","fromUtc","toUtc","page","pageSize"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"cancelOrder","description":"Cancel Derive spot, perpetual and option orders, including pending triggers and running TWAPs. Returns unsigned native cancellation requests (private/cancel, private/cancel_trigger_order or private/cancel_algo_order, one per order) for the userAddress wallet to sign in and send in order; the note says how. Pass the subaccount’s active orders in orders, as getOpenOrders’ requests answered them just before this call; the tool selects the scope’s targets among them, and for scope market or all refuses a list with an ended order. Use order for one UUID, market for one exact instrument, or all for a subaccount filtered by marketType. Make one call for the requested scope; never split a bulk request into ID calls. Report cancellations separately from executed fills; cancelling options does not close or settle positions. Report the result and stop without retrying or another trading action.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"scope":{"type":"string","enum":["order","market","all"],"description":"order for one ID, market for every supported order on one exact instrument, all for this subaccount filtered by marketType."},"subaccountId":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Owned trading subaccount from getOpenOrders."},"orderId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Derive UUID for order scope. Null otherwise."},"market":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact instrument name including its risk universe suffix when present, e.g. ETH-PERP or ETH-20261127-3000-C. Required for market scope. Null otherwise."},"marketType":{"anyOf":[{"type":"string","enum":["spot","futures","options","all"]},{"type":"null"}],"description":"Restrict to spot, futures or options. all explicitly includes all three. Null infers the type for an exact ID or market; with scope all, null preserves spot and perpetuals only. Use options for all option orders, all for every type, and null to leave options alone in a bulk cancellation."},"orders":{"type":"array","items":{"type":"object","properties":{"order_id":{"type":"string","description":"Derive order UUID (order_id of the row)."},"subaccount_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Subaccount that holds the order (subaccount_id of the row)."},"instrument_name":{"type":"string","description":"Exact instrument of the order, including any risk universe suffix (instrument_name of the row)."},"order_status":{"type":"string","enum":["open","filled","rejected","cancelled","expired","untriggered","algo_active"],"description":"Derive status of the order (order_status of the row), which selects the native cancellation method: open (resting, including a fired trigger), untriggered (pending trigger) or algo_active (running TWAP). An ended status (filled, rejected, cancelled or expired) gets no request: with scope order the tool answers that the order already ended, and with scope market or all it refuses the whole list."},"is_transfer":{"type":"boolean","description":"is_transfer of the row: true for a position transfer, which is not cancelled."},"quote_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"quote_id of the row: the RFQ quote ID of a quote order, which is not cancelled, else null."},"rfq_id":{"description":"rfq_id of the row when Derive gives one: an RFQ order, which is not cancelled.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["order_id","subaccount_id","instrument_name","order_status","is_transfer","quote_id"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"One Derive order row, unchanged; fields other than these are ignored."},"description":"The subaccount's active orders: the Derive order rows that getOpenOrders' requests answered, unchanged (for one order, getOrdersById's answer also works). Read them just before this call. Each needs order_id, subaccount_id, instrument_name, order_status, is_transfer and quote_id; other fields are ignored. The tool cancels only the orders of this list that fall in the scope: rows of other subaccounts are ignored, and position transfers and RFQ or quote orders (is_transfer true, or a quote_id or rfq_id) are never cancelled. For scope market or all, list only active rows (order_status open, untriggered or algo_active): an ended row of the subaccount makes the tool refuse. The cancel method follows each row's order_status, so a stale row can be cancelled with the wrong method and rejected."}},"required":["userAddress","scope","subaccountId","orderId","market","marketType","orders"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"editOrder","description":"Replace one resting Derive spot/perpetual limit or option long-entry buy by order ID and subaccount, changing its passive limit or remaining quantity. Returns one unsigned private/replace request (it cancels the original and places the replacement) with the EIP-712 action for the userAddress wallet to sign, then send; the note says how. Pass the original order in originalOrder exactly as getOrdersById or getOpenOrders answered it. Option sells, short buybacks, triggers and TWAPs are unsupported. Report both IDs, separate original/replacement fills, option premiums and UTC dates. Call once per user instruction; report the result and stop without retry or another trading action.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"orderId":{"type":"string","description":"UUID of the open resting order from getOpenOrders."},"subaccountId":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Subaccount that holds this order, from getOpenOrders."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"New limit price in human-readable decimal format (e.g. '1.5') in the quote asset; for options, premium per option unit. Pass null to keep the current resting limit."},"amount":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"New remaining quantity in human-readable decimal format (e.g. '1.5') in base asset units, or option units for an option, excluding previous fills. Pass null to keep it, or \"-1\" for the whole unfilled remainder of originalOrder (amount minus filled_amount). It is not the full position or available buying capacity."},"originalOrder":{"type":"object","properties":{"order_id":{"type":"string","description":"Derive order UUID; must equal orderId."},"subaccount_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Subaccount of the order; must equal subaccountId."},"instrument_name":{"type":"string","description":"Exact instrument name."},"direction":{"type":"string","enum":["buy","sell"],"description":"Order side."},"order_type":{"type":"string","description":"Derive order type (limit or market)."},"order_status":{"type":"string","description":"Derive order status; only open orders can be edited."},"time_in_force":{"type":"string","description":"Derive time in force (gtc, post_only, ...); the replacement keeps it."},"amount":{"type":"string","description":"Original order amount in human-readable decimal format (e.g. '1.5'), base asset or option units."},"filled_amount":{"type":"string","description":"Amount filled so far in human-readable decimal format (e.g. '1.5'); the replacement expects exactly this fill."},"limit_price":{"type":"string","description":"Current limit price in human-readable decimal format (e.g. '1.5'); for an option, the premium per unit."},"max_fee":{"type":"string","description":"Signed max fee per unit in human-readable decimal format (e.g. '1.5'); the replacement keeps it."},"extra_fee":{"type":"string","description":"Broker fee per unit in human-readable decimal format (e.g. '0'); an order with one cannot be edited."},"mmp":{"type":"boolean","description":"Market maker protection flag; the replacement keeps it."},"label":{"description":"Order label (Derive omits it or gives an empty string when none); the replacement keeps it.","type":"string"},"signature_expiry_sec":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Unix second the order signature expires; the replacement keeps this deadline."},"trigger_type":{"description":"Trigger type of a trigger order, else null or absent.","anyOf":[{"type":"string"},{"type":"null"}]},"trigger_price":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Trigger price of a trigger order, else null."},"trigger_price_type":{"description":"Trigger price type of a trigger order, else null or absent.","anyOf":[{"type":"string"},{"type":"null"}]},"algo_type":{"description":"Algorithm (twap) of an algo order, else null or absent.","anyOf":[{"type":"string"},{"type":"null"}]},"is_transfer":{"type":"boolean","description":"True for a position transfer."},"quote_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RFQ quote ID, else null."}},"required":["order_id","subaccount_id","instrument_name","direction","order_type","order_status","time_in_force","amount","filled_amount","limit_price","max_fee","extra_fee","mmp","signature_expiry_sec","trigger_price","is_transfer","quote_id"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"The order to edit as Derive answered it to the getOrdersById request (private/get_order) or a getOpenOrders list request: pass that row unchanged (fields other than these are ignored; label, trigger_type, trigger_price_type and algo_type may be absent, as Derive omits them). Read it shortly before the edit: the replacement expects its filled_amount, and Derive rejects the edit (error 11028) if the order filled further since."}},"required":["userAddress","orderId","subaccountId","limitPrice","amount","originalOrder"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"openPerp","description":"Open a Derive perpetual position with a market or limit order from the wallet's subaccount of the market's risk universe, optionally with a take profit and a stop loss: one private/order for the entry, then one for the stop loss and one for the take profit, reduce-only market orders that trigger on the mark price and are signed for 89 days. A held position is reduced or closed with modifyPositionSize or closePerp, also at a limit price, not with an opposite order. A take profit or stop loss is added to a held position with addPositionTrigger. A market order is built with a worst price of the mark price ± 1%. Every order is previewed with Derive's public order quote before it is built (margin, fee cap, liquidation price). Nothing is signed or sent: the tool returns unsigned Derive API requests for the userAddress wallet, whose login headers and EIP-712 order signature (body.signature, from toSign) the caller fills in as the note says, then sends the entry first and stops if Derive answers it with an error. The stop loss and take profit are sent only once Derive has accepted the entry, and then each on its own, even if Derive rejects or does not confirm the other: for them this replaces the signing recipe's \"stop at the first error\". Fills and acceptance are what Derive answers to each request. Show the signature expiry times the note states with the UTC timezone.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"asset":{"type":"string","description":"Perpetual by base asset or market name, e.g. \"ETH\" or \"BTC-PERP\"."},"size":{"type":"string","description":"Size is the FINAL trade size after leverage (total notional to transact), not margin. Do NOT scale, prorate, or recalc it by leverage or price by yourself.\nOnly exception: if the user explicitly gives the margin instead of the size (e.g. \"$4 as margin with 10x leverage\"), pass margin × leverage in the same unit (size 40, sizeUnit USD).\nOtherwise the user always provides the final size, and you cannot change it in any way. You must pass it as-is using the correct \"sizeUnit\" value.\nsizeUnit:\n• ASSET — the size specified directly in the underlying asset (e.g., 1 BTC). If the user gives a ASSET size, use it directly as the trade size in ASSET.\n• USD — the size specified in USD (e.g., 1000 USD). If the user gives a USD size, use it directly as the trade size in USD.\nDo NOT convert between ASSET and USD."},"sizeUnit":{"type":"string","enum":["ASSET","USD"],"description":"Specifies whether the size is denominated in asset units or in USD."},"short":{"type":"boolean","description":"If true, opens a short position; if false, opens a long position."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Price in USDC for a limit order, which rests on the book until filled; a price that would fill at once is refused. If the user has not specified the price, pass null for a market order."},"takeProfitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional. If not specified by the user then pass null. Mark price at which a take-profit order closes the position."},"stopLossPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional. If not specified by the user then pass null. Mark price at which a stop-loss order closes the position."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Subaccount to trade from, as getBalances lists it; null for the wallet's subaccount of the market's risk universe."},"marginType":{"anyOf":[{"type":"string","enum":["SM","PM2"]},{"type":"null"}],"description":"Standard (SM) or portfolio (PM2) margin of the subaccount to trade from, when subaccountId is null; null for either."}},"required":["userAddress","asset","size","sizeUnit","short","limitPrice","takeProfitPrice","stopLossPrice","subaccountId","marginType"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"modifyPositionSize","description":"Increase or decrease an open Derive perpetual position by an asset amount, a USD amount or a percentage of the position, with one private/order from the subaccount that holds it. A positive size increases the position and a negative size decreases it; a decrease is reduce-only and never flips the position. A market order is built with a worst price of the mark price ± 1%. The order is previewed with Derive's public order quote before it is built. Nothing is signed or sent: the tool returns unsigned Derive API requests for the userAddress wallet, whose login headers and EIP-712 order signature (body.signature, from toSign) the caller fills in as the note says, then sends them in order, stopping at the first error. Fills and acceptance are what Derive answers to each request. Show the signature expiry the note states with the UTC timezone.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"asset":{"type":"string","description":"Perpetual of the position, by base asset or market name, e.g. \"ETH\" or \"BTC-PERP\"."},"sizeUnit":{"type":"string","enum":["USD","ASSET","PERCENT"],"description":"Unit of the position size change: USD value, underlying asset amount, or percentage of the current position."},"size":{"type":"string","description":"Signed position size change in decimal format. Positive values increase and negative values decrease; \"-1\" is minus one unit, not all. For PERCENT, use a decimal fraction: 0.6 increases by 60% and -0.3 decreases by 30%; a decrease must stay below 100%."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Price in USDC for a limit order: an increase rests on the book until filled (a price that would fill at once is refused); a decrease fills at once at this price or better, or is refused. If the user has not specified a price, pass null for a market order."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Subaccount that holds the position, as getPerpPositions lists it; null for the wallet's only subaccount holding that market."}},"required":["userAddress","asset","sizeUnit","size","limitPrice","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"closeAllPositions","description":"Call this tool once to close all perpetual positions on the requested owned non-vault subaccount(s). It returns one price-protected, reduce-only market order (private/order, worst price within 1% of the mark) per open position, each previewed with Derive's public order quote. A position that changed while it was read, exceeds the single-order maximum, would leave a remainder below one amount step, or whose close Derive's preview refuses ends the batch, and so does one reached more than 60 seconds after the first close was built (most of the signature window is kept for sending): the positions after it are not prepared and the note lists them, as it lists the owned vault subaccounts left out of scope. Positions are read only while the batch is built (once to find them, then once per close); they are not rechecked before each send, so a position that changes in between (a trigger or TWAP fill) can remain open even after a close Derive answers as filled: confirm with getPerpPositions. Every close is built at call time with a worst price from the current mark and a signature that expires about 5 minutes later (the UTC time the note states), so send the whole batch before then; a close not sent by its expiry must not be sent, and the positions left open need a new closeAllPositions call after a new user message. Send the closes one at a time in order and stop at the first error or at a close Derive does not answer as filled in full; report the results and stop. A new user message is required for any further close, including after a status check. Independent orders, triggers and TWAPs remain active. Nothing is signed or sent: the tool returns unsigned Derive API requests for the userAddress wallet, whose login headers and EIP-712 order signature (body.signature, from toSign) the caller fills in as the note says, then sends them in order, stopping at the first error. Fills and acceptance are what Derive answers to each request.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"An owned non-vault subaccount, or explicit null to close positions across all owned non-vault subaccounts."}},"required":["userAddress","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"closePerp","description":"Close an open Derive perpetual position from the subaccount that holds it, with one reduce-only private/order: a market order with a worst price of the mark price ± 1%, or a limit order at the price the user names, which fills at once or is refused. The order is previewed with Derive's public order quote before it is built. Nothing is signed or sent: the tool returns unsigned Derive API requests for the userAddress wallet, whose login headers and EIP-712 order signature (body.signature, from toSign) the caller fills in as the note says, then sends them in order, stopping at the first error. Fills and acceptance are what Derive answers to each request.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"asset":{"type":"string","description":"Perpetual of the position, by base asset or market name, e.g. \"ETH\" or \"BTC-PERP\"."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Price in USDC for a limit close, which fills at once at this price or better, or is refused. If the user has not specified a price, pass null for a market order."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Subaccount that holds the position, as getPerpPositions lists it; null for the wallet's only subaccount holding that market."}},"required":["userAddress","asset","limitPrice","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"addPositionTrigger","description":"Add a take profit or a stop loss to an open Derive perpetual position, from the subaccount that holds it: one private/order, a reduce-only market order for the whole position as held now, which triggers on the mark price with a worst price 8% past the trigger price and is signed for 89 days. It adds a separate order: it does not move or replace earlier take-profit or stop-loss orders, and it does not follow later changes of the position size. A stop loss past the position's liquidation price is refused, and the order is previewed with Derive's public order quote before it is built. Nothing is signed or sent: the tool returns unsigned Derive API requests for the userAddress wallet, whose login headers and EIP-712 order signature (body.signature, from toSign) the caller fills in as the note says, then sends them in order, stopping at the first error. Fills and acceptance are what Derive answers to each request. Show the signature expiry the note states with the UTC timezone.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"asset":{"type":"string","description":"Perpetual of the position, by base asset or market name, e.g. \"ETH\" or \"BTC-PERP\"."},"type":{"type":"string","enum":["tp","sl"],"description":"Trigger type: \"tp\" for take profit or \"sl\" for stop loss."},"price":{"type":"string","description":"Mark price in USDC at which the order triggers: for a long, a take profit above the current mark price and a stop loss below it; for a short, the reverse. A price on the other side is refused."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Subaccount that holds the position, as getPerpPositions lists it; null for the wallet's only subaccount holding that market."}},"required":["userAddress","asset","type","price","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"createTriggerOrder","description":"Place a Derive perpetual order that waits until the mark price reaches triggerPrice and then opens a long or short position, or adds to a held one of the same side, from the wallet's subaccount of the market's risk universe: one private/order, signed for 89 days, that sends a market order with a worst price 1% past the trigger price, or a limit order at limitPrice that then rests on the book until filled. It is not reduce-only and attaches no take profit or stop loss; a trigger order opposite to a held position is refused. An entry now, or a limit order that rests on the book now, is placed with openPerp; a take profit or stop loss on a held position is added with addPositionTrigger. The order and the same market order now (for the margin) are previewed with Derive's public order quote before it is built. Nothing is signed or sent: the tool returns unsigned Derive API requests for the userAddress wallet, whose login headers and EIP-712 order signature (body.signature, from toSign) the caller fills in as the note says, then sends them in order, stopping at the first error. Fills and acceptance are what Derive answers to each request. Show the signature expiry the note states with the UTC timezone.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"asset":{"type":"string","description":"Perpetual by base asset or market name, e.g. \"ETH\" or \"BTC-PERP\"."},"size":{"type":"string","description":"Size is the FINAL trade size after leverage (total notional to transact), not margin. Do NOT scale, prorate, or recalc it by leverage or price by yourself.\nOnly exception: if the user explicitly gives the margin instead of the size (e.g. \"$4 as margin with 10x leverage\"), pass margin × leverage in the same unit (size 40, sizeUnit USD).\nOtherwise the user always provides the final size, and you cannot change it in any way. You must pass it as-is using the correct \"sizeUnit\" value.\nsizeUnit:\n• ASSET — the size specified directly in the underlying asset (e.g., 1 BTC). If the user gives a ASSET size, use it directly as the trade size in ASSET.\n• USD — the size specified in USD (e.g., 1000 USD). If the user gives a USD size, use it directly as the trade size in USD.\nDo NOT convert between ASSET and USD."},"sizeUnit":{"type":"string","enum":["ASSET","USD"],"description":"Specifies whether the size is denominated in asset units or in USD."},"short":{"type":"boolean","description":"If true, opens a short position; if false, opens a long position."},"triggerPrice":{"type":"string","description":"Mark price in USDC at which the order is sent: a price above the current mark price fires when the mark rises to it, one below when it falls to it; the current mark price itself is refused."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional. If not specified by the user then pass null. Price in USDC of the limit order sent when the trigger fires, which then rests on the book until filled; null for a market order when triggered."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Subaccount to trade from, as getBalances lists it; null for the wallet's subaccount of the market's risk universe."},"marginType":{"anyOf":[{"type":"string","enum":["SM","PM2"]},{"type":"null"}],"description":"Standard (SM) or portfolio (PM2) margin of the subaccount to trade from, when subaccountId is null; null for either."}},"required":["userAddress","asset","size","sizeUnit","short","triggerPrice","limitPrice","subaccountId","marginType"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"createTwapOrder","description":"Start a TWAP on a Derive perpetual with one private/order: Derive splits the size into equal immediate-or-cancel limit orders at the worst price, sent evenly over durationMinutes, each filling at once at the worst price or better. It opens or adds to a position from the wallet's subaccount of the market's risk universe, or with reduceOnly reduces or closes the held position over time. The worst price is limitPrice for every slice, or the mark price ± 1% at the start. The order is previewed with Derive's public order quote as one IOC limit order before it is built; Derive's answer shows whether it runs as a TWAP. Nothing is signed or sent: the tool returns unsigned Derive API requests for the userAddress wallet, whose login headers and EIP-712 order signature (body.signature, from toSign) the caller fills in as the note says, then sends them in order, stopping at the first error. Fills and acceptance are what Derive answers to each request. Its signature expires durationMinutes + 60 minutes after this build (the UTC time the note states): send it within 60 minutes, or the TWAP stops at that expiry before its last slices. Show the estimated end and the signature expiry the note states with the UTC timezone.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"asset":{"type":"string","description":"Perpetual by base asset or market name, e.g. \"ETH\" or \"BTC-PERP\"."},"isBuy":{"type":"boolean","description":"If true, buys (opens or adds to a long, or with reduceOnly reduces a short); if false, sells."},"size":{"type":"string","description":"Size is the FINAL trade size after leverage (total notional to transact), not margin. Do NOT scale, prorate, or recalc it by leverage or price by yourself.\nOnly exception: if the user explicitly gives the margin instead of the size (e.g. \"$4 as margin with 10x leverage\"), pass margin × leverage in the same unit (size 40, sizeUnit USD).\nOtherwise the user always provides the final size, and you cannot change it in any way. You must pass it as-is using the correct \"sizeUnit\" value.\nsizeUnit:\n• ASSET — the size specified directly in the underlying asset (e.g., 1 BTC). If the user gives a ASSET size, use it directly as the trade size in ASSET.\n• USD — the size specified in USD (e.g., 1000 USD). If the user gives a USD size, use it directly as the trade size in USD.\nDo NOT convert between ASSET and USD.\nIt is the total of all slices together.\nWith reduceOnly, pass \"-1\" to reduce the whole position held; sizeUnit is then ignored."},"sizeUnit":{"type":"string","enum":["ASSET","USD"],"description":"Specifies whether the size is denominated in asset units or in USD."},"durationMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minutes the TWAP runs, from 5 to 1440."},"slices":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Number of equal orders the size is split into, at least 2 and at most one every 12 seconds. If not specified by the user then pass null for one every 30 seconds."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Worst price in USDC for every slice over the whole TWAP: a buy fills at it or lower, a sell at it or higher; Derive refuses one outside its price band around the mark. If not specified by the user then pass null for the mark price ± 1% at the start."},"reduceOnly":{"type":"boolean","description":"If true, only reduces or closes the position held in the market, isBuy being its opposite side; if false, opens or adds to a position."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Subaccount to trade from, as getBalances lists it; with reduceOnly the one holding the position, as getPerpPositions lists it. Null for the wallet's subaccount of the market's risk universe, or its only one holding the position."},"marginType":{"anyOf":[{"type":"string","enum":["SM","PM2"]},{"type":"null"}],"description":"Standard (SM) or portfolio (PM2) margin of the subaccount to trade from, when subaccountId is null; null for either."}},"required":["userAddress","asset","isBuy","size","sizeUnit","durationMinutes","slices","limitPrice","reduceOnly","subaccountId","marginType"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"createSpotOrder","description":"Buy or sell a Derive spot pair quoted in USDC (e.g. ETH-USDC) with a market or limit order, from the userAddress wallet's subaccount of the pair's risk universe; bought tokens stay in that subaccount as collateral, as getBalances lists them. A buy spends only USDC the subaccount holds and a sell only the token it holds. The amount is checked against what the subaccount holds by its public margin read; what its other open orders, pending trigger orders and TWAPs reserve of the same funds is not checked, so check getOpenOrders when they may spend them. A market order is built with a worst price of the mark price ± 1%; a limit order rests on the book until filled, and a limit price that would fill at once is refused. Returns one unsigned private/order request with an EIP-712 toSign: the userAddress wallet signs the login and the order and sends it, as the note says. Nothing is placed until it is sent. The note states the signed amount, price, fee cap and signature expiry: show it with the UTC timezone.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"token":{"type":"string","description":"Spot pair by base token or market name, e.g. \"ETH\", \"WBTC\", \"DRV\" or \"ETH-USDC\"; \"WETH\" is ETH."},"isBuy":{"type":"boolean","description":"If true, creates a buy order; if false, creates a sell order."},"amount":{"type":"string","description":"Amount to buy or sell on spot. Pass it as-is using the correct \"amountUnit\" value.\nPass \"-1\" to buy with all the USDC the subaccount holds, less the fee, or to sell all of the token it holds, in whole amount steps; amountUnit is then ignored.\namountUnit:\n• ASSET — the amount specified directly in the token (e.g., 1 ETH). If the user gives an ASSET amount, use it directly.\n• USD — the amount specified in USD (e.g., 1000 USD). If the user gives a USD amount, use it directly. USD = USDC/$. A buy in USD is sized at its limit price, or for a market buy at its worst price; a sell at its limit price or the mark price.\nDo NOT convert between ASSET and USD."},"amountUnit":{"type":"string","enum":["ASSET","USD"],"description":"Specifies whether the amount is denominated in asset units or in USD."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Price in USDC for a limit order, which rests on the book until filled; a price that would fill at once is refused. If the user has not specified the price, pass null for a market order."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Subaccount to trade from, as getBalances lists it; null for the wallet's subaccount of the pair's risk universe that holds the USDC to spend or the token to sell."}},"required":["userAddress","token","isBuy","amount","amountUnit","limitPrice","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"createSpotTriggerOrder","description":"Build one standalone conditional Derive spot buy or sell. When the pair’s mark reaches triggerPrice, Derive submits a market order with a worst price 1% past the trigger, or a limit order at limitPrice. Use for spot breakouts, dip buys, take profits or stop losses. Use createSpotOrder for immediate spot trades. The amount is checked against what the subaccount holds by its public margin read; what its other open orders, pending trigger orders and TWAPs reserve of the same funds is not checked, so check getOpenOrders when they may spend them. Returns one unsigned private/order request with an EIP-712 toSign: the userAddress wallet signs the login and the order and sends it, as the note says. Nothing is placed until it is sent. The note states the trigger, the worst or limit price, the fee cap and the signature expiry: show it in UTC. If Derive refuses the order or the outcome is uncertain, report it and stop. Another order requires a new user request.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"token":{"type":"string","description":"Derive spot base token or full pair, e.g. ETH or DRV-USDC."},"isBuy":{"type":"boolean","description":"True to buy the base token on trigger, false to sell."},"amount":{"type":"string","description":"Quantity in amountUnit. For all, pass \"-1\" to spend the USDC the subaccount holds including buy fees or sell all the base tokens it holds. The quantity is fixed when signed."},"amountUnit":{"type":"string","enum":["ASSET","USD"],"description":"ASSET for base tokens or USD for quote notional. Pass the user’s amount in its stated unit."},"triggerPrice":{"type":"string","description":"Mark price in USDC at which the spot order activates."},"triggerDirection":{"anyOf":[{"type":"string","enum":["above","below"]},{"type":"null"}],"description":"Use above for an explicit rise or breakout and below for an explicit fall or dip. For a sell take profit use above, and for a sell stop loss use below. Null when the user gives only a price."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Limit price after activation if explicitly requested. Null for a market order bounded from the trigger price."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owned trading subaccount. Null selects a spot subaccount in the pair’s risk universe with the asset to spend."}},"required":["userAddress","token","isBuy","amount","amountUnit","triggerPrice","triggerDirection","limitPrice","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"createSpotTwapOrder","description":"Start one native Derive TWAP to buy or sell a USDC-quoted spot pair over 1–1440 whole minutes. Spot slices must be at least 10 seconds apart. Derive sends bounded immediate-or-cancel slices. The amount is checked against what the subaccount holds by its public margin read; what its other open orders, pending trigger orders and TWAPs reserve of the same funds is not checked, so check getOpenOrders when they may spend them. Derive's spot form allows at most 5 active TWAPs per subaccount; this is not checked, so check getOpenOrders first. Returns one unsigned private/order request with an EIP-712 toSign: the userAddress wallet signs the login and the order and sends it, as the note says. Nothing is placed until it is sent. The note states the scheduled total, slice count and size, the price bound, the fee cap, the estimated end and the signature expiry; if it calls the slice size an estimate, individual slice quantities are unknown. Its signature expires durationMinutes + 60 minutes after this build (the UTC time the note states): send it within 60 minutes, or the TWAP stops at that expiry before its last slices. Show the estimated end and the signature expiry in UTC. After sending, track the TWAP and its fills with getOpenOrders and getOrdersById; cancelOrder stops future slices. On a refusal or uncertain outcome, report it and stop. Another order requires a new user request.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"token":{"type":"string","description":"Spot base token or full pair, e.g. ETH or ETH-USDC."},"isBuy":{"type":"boolean","description":"True to buy the base token, false to sell it."},"amount":{"type":"string","description":"Total amount across all slices in amountUnit. Pass \"-1\" to use the USDC the subaccount holds after fees or to sell the base token it holds."},"amountUnit":{"type":"string","enum":["ASSET","USD"],"description":"ASSET for base-token units or USD for dollar sizing."},"durationMinutes":{"type":"integer","minimum":1,"maximum":1440,"description":"Spot duration in whole minutes, 1 through 1440."},"slices":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Number of slices, at least 2, spaced at least 10 seconds apart. Null selects roughly one every 30 seconds."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Maximum buy price or minimum sell price for every slice. Null selects the starting mark price ± 1% rounded inward to the tick."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owned trading subaccount, or null to select the eligible subaccount with the funds to trade."}},"required":["userAddress","token","isBuy","amount","amountUnit","durationMinutes","slices","limitPrice","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"createOptionOrder","description":"Call once per user instruction to build one single-leg Derive option order. Buy to open or add to a long, sell to reduce a long, or buy back a short. Derive's preview is read afresh and must pass first. Returns one unsigned private/order request with an EIP-712 toSign: the userAddress wallet signs the login and the order and sends it, as the note says. Nothing is placed until it is sent. The note states the size, limitPrice (label it as the protective bound), the fee cap, Derive's projected fill and fee in USD, and the UTC times. After sending, check the order ID, filled and resting quantities and premium with getOrdersById and the holding with getOptionPositions. Report the result and stop, including after a refusal, partial fill or uncertain submission. A new user message is required before calling again.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"market":{"type":"string","description":"Exact Derive option instrument name, including any risk universe suffix."},"isBuy":{"type":"boolean","description":"True to buy to open/add a long or buy back a short. False to sell a held long with reduceOnly."},"size":{"type":"string","description":"Positive quantity in option units, or exactly \"-1\" for the maximum in one order. When the user requests all, pass \"-1\" so the tool reads fresh account capacity or holdings."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Maximum buy or minimum sell premium per unit. Null selects a bounded market order. An opening limit is GTC and a reduce-only limit is IOC."},"reduceOnly":{"type":"boolean","description":"True to reduce the selected holding without reversing it. False to open or add to a long."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owned personal subaccount ID. Null selects the only eligible account, or the only holder for a reduction."}},"required":["userAddress","market","isBuy","size","limitPrice","reduceOnly","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"closeOptionPosition","description":"Call once to close the entire tradable holding of one Derive option series. The tool finds the held side and builds one reduce-only order. Returns one unsigned private/order request with an EIP-712 toSign: the userAddress wallet signs the login and the order and sends it, as the note says. Nothing is placed until it is sent. The note states the signed holding before the order and the holding expected if it fills completely. After sending, verify the holding with getOptionPositions and report closed only when it shows none of the series. Stop after the result, including any refusal, partial fill, or unconfirmed outcome. A further order requires a new user instruction. Show dates in UTC.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"market":{"type":"string","description":"Exact Derive option instrument name, including any risk universe suffix."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Premium per option unit for an immediate-or-cancel limit. This is a minimum sell premium for a long or maximum buy premium for a short. Null uses a bounded market order."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owned personal subaccount holding this exact series. Null selects the only holder."}},"required":["userAddress","market","limitPrice","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"apiRequestActions":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"The URL of the API request"},"method":{"type":"string","enum":["POST","GET","PUT","DELETE"],"description":"HTTP method"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Request headers"},"body":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Request body as JSON object"},"toSign":{"description":"EIP-712 payload to sign (required for EIP-712 flows, omitted for unsigned API requests)","type":"object","properties":{"domain":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"types":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"additionalProperties":false}}},"message":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"primaryType":{"type":"string"}},"required":["domain","types","message","primaryType"],"additionalProperties":false}},"required":["url","method","headers","body"],"additionalProperties":false},"description":"Unsigned Derive API requests, in order. Fill in the login headers, and body.signature from toSign where present, as the note says; send them in order and stop at the first error, unless the note gives another send rule."}},"required":["project","operation","apiRequestActions"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}},{"name":"getOptionOrderQuote","description":"Preview one Derive option order for the userAddress wallet using an exact series; nothing is signed. Report estimatedFillPremium as the projected fill premium per unit. Label limitPrice separately as the maximum buy or minimum sell premium. Show projected quantity, fees, initial margin, any rejection, and UTC times. For a reduction, show estimatedRealizedPnlExclFees in USD: the tool calculates it from averagePremiumExclFees and the projected fill premium and quantity, as Derive's option preview returns no realized PnL estimate. It excludes estimatedFee. Null means no estimate; never show it as zero.","inputSchema":{"type":"object","properties":{"userAddress":{"type":"string","description":"EVM address (0x…) of the wallet that owns the Derive account. Its subaccounts are read for it, and every private request this tool returns is built for it: the same wallet signs the login and any action."},"market":{"type":"string","description":"Exact Derive option instrument name, including any risk universe suffix."},"isBuy":{"type":"boolean","description":"True to buy to open/add a long or buy back a short. False to sell a held long with reduceOnly."},"size":{"type":"string","description":"Positive quantity in option units, or exactly \"-1\" for the maximum in one order. When the user requests all, pass \"-1\" so the tool reads fresh account capacity or holdings."},"limitPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Maximum buy or minimum sell premium per unit. Null selects a bounded market order. An opening limit is GTC and a reduce-only limit is IOC."},"reduceOnly":{"type":"boolean","description":"True to reduce the selected holding without reversing it. False to open or add to a long."},"subaccountId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Owned personal subaccount ID. Null selects the only eligible account, or the only holder for a reduction."}},"required":["userAddress","market","isBuy","size","limitPrice","reduceOnly","subaccountId"],"additionalProperties":false},"outputSchema":{"type":"object","anyOf":[{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"note":{"description":"Human-readable summary; for private requests it starts with how to sign and send them","type":"string"},"data":{"type":"object","properties":{"wallet":{"type":"string","description":"The userAddress wallet, checksummed"},"subaccountId":{"type":"number","description":"Personal subaccount the order is previewed for"},"market":{"type":"string","description":"Exact option series"},"optionType":{"type":"string","enum":["call","put"],"description":"Call or put"},"strike":{"type":"string","description":"Strike price in human-readable decimal format (e.g. '3000')"},"expiryUtc":{"type":"string","description":"Contract expiry, ISO 8601 UTC"},"tradingEndsAtUtc":{"type":"string","description":"When the series stops trading, ISO 8601 UTC"},"quoteCurrency":{"type":"string","description":"Currency the premium is quoted and settled in"},"riskUniverseId":{"type":"number","description":"Risk universe of the series"},"baseAssetAddress":{"type":"string","description":"Protocol asset the order signs for"},"baseAssetSubId":{"type":"string","description":"Sub id of that asset (the series)"},"tickSize":{"type":"string","description":"Premium tick size"},"amountStep":{"type":"string","description":"Order size step in option units"},"minAmount":{"type":"string","description":"Smallest opening order in option units"},"underlying":{"type":"string","description":"Underlying asset, e.g. ETH"},"side":{"type":"string","description":"Side of the previewed order: buy or sell"},"reduceOnly":{"type":"boolean","description":"True when the order only reduces the holding"},"requestedSize":{"type":"string","description":"size as requested, \"-1\" for the maximum"},"size":{"type":"string","description":"Previewed size in option units, in human-readable decimal format (e.g. '1.5')"},"orderType":{"type":"string","description":"market or limit"},"timeInForce":{"type":"string","description":"gtc for an opening limit or a market order, ioc for a reduce-only limit"},"limitPrice":{"type":"string","description":"The protective bound: maximum buy or minimum sell premium per unit"},"indexPrice":{"type":"string","description":"Index price of the underlying"},"quotedAtUtc":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"When the preview was made, ISO 8601 UTC"},"isValid":{"type":"boolean","description":"Derive's verdict on the order"},"invalidReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why Derive would refuse it, when isValid is false"},"estimatedOrderStatus":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Derive's projected order status, e.g. filled, open or cancelled"},"estimatedFillAmount":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Projected filled quantity in option units"},"estimatedFillPremium":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Projected premium per filled unit; null without a fill"},"estimatedPremiumTotal":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Projected filled quantity times its premium, before fees"},"estimatedFee":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Projected total fee of the fill, in USD"},"suggestedMaxFeePerUnit":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Derive's suggested fee cap per unit, in USD"},"preInitialMargin":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Initial margin headroom of the subaccount before the order, in USD"},"postInitialMargin":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Initial margin headroom of the subaccount after the order, in USD"},"postLiquidationPrice":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Derive's liquidation price estimate after the order"},"maxAmount":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The most Derive's preview lets the subaccount trade in one order, in option units"},"averagePremiumExclFees":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Average premium per unit of the held position excluding fees; null without a holding"},"estimatedRealizedPnlExclFees":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Calculated by this tool for an order that reduces the holding, in USD, excluding fees; null means no estimate, never zero"}},"required":["wallet","subaccountId","market","optionType","strike","expiryUtc","tradingEndsAtUtc","quoteCurrency","riskUniverseId","baseAssetAddress","baseAssetSubId","tickSize","amountStep","minAmount","underlying","side","reduceOnly","requestedSize","size","orderType","timeInForce","limitPrice","indexPrice","quotedAtUtc","isValid","invalidReason","estimatedOrderStatus","estimatedFillAmount","estimatedFillPremium","estimatedPremiumTotal","estimatedFee","suggestedMaxFeePerUnit","preInitialMargin","postInitialMargin","postLiquidationPrice","maxAmount","averagePremiumExclFees","estimatedRealizedPnlExclFees"],"additionalProperties":false}},"required":["project","operation","data"],"additionalProperties":false},{"type":"object","properties":{"project":{"type":"string","description":"Protocol identifier"},"operation":{"type":"string","description":"Operation that produced this response"},"error":{"type":"string","description":"Error message"}},"required":["project","operation","error"],"additionalProperties":false}]}}]}