# Upside DEX ## Docs - [Agent Wallets for Automated Trading](https://docs.upsidemax.xyz/agents/api-wallets.md): Authorize a dedicated API wallet to trade for a master account while keeping the master private key offline, with expiry, monitoring, rotation, and revocation controls. - [LLMs.txt for Upside](https://docs.upsidemax.xyz/agents/llms-txt.md): Use Upside machine-readable Markdown documentation with coding assistants, custom agents, and retrieval pipelines. - [AI Agents on Upside](https://docs.upsidemax.xyz/agents/overview.md): Connect coding assistants and automated trading agents to Upside using machine-readable docs, signed write requests, unsigned reads, and real-time WebSocket streams. - [approveAgent: Authorize an API Wallet for Automated Trading](https://docs.upsidemax.xyz/exchange/approve-agent.md): Approve an agent wallet to sign trade operations on behalf of your master account, keeping your master private key offline during automated trading. - [cancel: Cancel Resting Orders by Exchange Order ID](https://docs.upsidemax.xyz/exchange/cancel.md): Cancel one or more resting orders using the exchange-assigned order IDs (oid) returned when the orders were placed. Supports batches of up to 10. - [cancelAll: Cancel All Open Orders for One Contract](https://docs.upsidemax.xyz/exchange/cancel-all.md): Cancel every open limit and conditional order for a specific contract in one request. The response reports how many orders of each type were removed. - [cancelByCloid: Cancel Orders by Client Order ID](https://docs.upsidemax.xyz/exchange/cancel-by-cloid.md): Cancel resting orders using the client order IDs you assigned at placement. Useful when you track orders by your own IDs without storing exchange oids. - [cancelConditional: Cancel a Single Conditional Order](https://docs.upsidemax.xyz/exchange/cancel-conditional.md): Cancel one conditional order by its order ID. Works for TP/SL and standalone triggers. Returns an error if not found or owned by a different user. - [cancelTpSl: Cancel All TP/SL for a Position](https://docs.upsidemax.xyz/exchange/cancel-tp-sl.md): Cancel all take-profit and stop-loss trigger orders for a specific position in one request. Returns a count of cancelled orders; zero is not an error. - [enrollUserToMarketDeployer: Join a Market Deployer](https://docs.upsidemax.xyz/exchange/enroll-user-to-market-deployer.md): Enroll your account in a market deployer before trading its contracts or transferring collateral in multi-market-deployer setups on Upside . - [lockCollateral: Deposit Funds into a Market Deployer](https://docs.upsidemax.xyz/exchange/lock-collateral.md): Move funds from your chain-level balance into a market deployer cross margin pool, making them available as margin for trading that deployer's contracts. - [lockIntoShareGroup: Deposit Chain Funds into a Share Group](https://docs.upsidemax.xyz/exchange/lock-into-share-group.md): Move funds from your chain-level balance into a share group margin pool directly, bypassing the per-market-deployer step for PORTFOLIO mode trading. - [modify: Update an Open Order Price, Size, or TIF](https://docs.upsidemax.xyz/exchange/modify.md): Modify a resting order's price, quantity, time-in-force, or client order ID. Locate the order by exchange order ID or client order ID. - [order: Place Limit and Market Orders on Upside](https://docs.upsidemax.xyz/exchange/order.md): Place limit (GTC, IOC, ALO) or market orders on Upside. Submit up to 10 orders in a single batched request using compact single-letter keys. - [POST /exchange – Write API Overview for Upside](https://docs.upsidemax.xyz/exchange/overview.md): All state-changing operations on Upside route through POST /exchange and are dispatched by the action.type field in your request body. - [registerAccount: Register Your Wallet on Upside](https://docs.upsidemax.xyz/exchange/register-account.md): Register your wallet address with Upside to receive a unique accountId required for all subsequent trading and collateral operations. - [revokeAgent: Remove an Authorized API Wallet](https://docs.upsidemax.xyz/exchange/revoke-agent.md): Revoke a previously authorized agent wallet so it can no longer sign operations for your master account. The agent is invalidated immediately upon success. - [setMarginShareType: Switch Account Margin Share Mode](https://docs.upsidemax.xyz/exchange/set-margin-share-type.md): Switch your account between UNIFIED mode (isolated per-MD margin) and PORTFOLIO mode (shared group margin pool) to control how margin is allocated. - [tpSl: Create Take-Profit and Stop-Loss Orders](https://docs.upsidemax.xyz/exchange/tp-sl.md): Create TP/SL trigger orders for an existing position. These orders don't consume margin and fire automatically when the trigger price is reached. - [transferBetweenDeployers: Move Funds Between Deployers](https://docs.upsidemax.xyz/exchange/transfer-between-deployers.md): Transfer cross margin funds directly between two market deployers within your account, leaving your chain-level balance completely unaffected. - [transferMdToShareGroup: Move Funds into a Share Group](https://docs.upsidemax.xyz/exchange/transfer-md-to-share-group.md): Transfer margin from a market deployer cross margin pool into a portfolio share group pool to fund PORTFOLIO mode margin sharing across contracts. - [transferShareGroupToMd: Move Funds from Share Group](https://docs.upsidemax.xyz/exchange/transfer-share-group-to-md.md): Transfer available margin from a portfolio share group pool back into a market deployer cross margin pool to rebalance between margin modes. - [unlockCollateral: Withdraw Funds from a Market Deployer](https://docs.upsidemax.xyz/exchange/unlock-collateral.md): Move available margin from a market deployer cross margin pool back to your chain-level balance, subject to position and order margin requirements. - [unlockFromShareGroup: Withdraw Funds from a Share Group](https://docs.upsidemax.xyz/exchange/unlock-from-share-group.md): Withdraw available funds from a portfolio share group margin pool to your chain-level balance, subject to group equity and margin requirement constraints. - [updateFeeSetting: Override Fee Rates per Market Deployer](https://docs.upsidemax.xyz/exchange/update-fee-setting.md): Set per-user taker and maker fee rate overrides within a market deployer. User-level overrides take the highest priority in the three-tier fee hierarchy. - [updateIsolatedMargin: Add or Remove Isolated Position Margin](https://docs.upsidemax.xyz/exchange/update-isolated-margin.md): Adjust the margin allocated to an isolated position without closing it, moving funds between your cross margin pool and the isolated position. - [updateLeverage: Set Per-Contract Leverage](https://docs.upsidemax.xyz/exchange/update-leverage.md): Adjust leverage for a specific contract. Reducing leverage triggers a margin check against existing positions to ensure requirements are met. - [updateMarginMode: Switch Between Cross and Isolated Margin](https://docs.upsidemax.xyz/exchange/update-margin-mode.md): Switch a contract between cross margin (shared pool) and isolated margin (per-position allocation), subject to having no open positions or orders. - [How to Sign Upside Write Requests with EIP-712 ECDSA](https://docs.upsidemax.xyz/guide/authentication.md): Learn how to sign POST /exchange requests using EIP-712 structured-data signatures over secp256k1. The server recovers your identity from the signature — no API keys needed. - [Upside API Data Types, Formats, and Conventions](https://docs.upsidemax.xyz/guide/data-types.md): Reference for numeric strings, timestamps, address format, contract IDs, client order IDs, and the short key convention used in order payloads. - [Error Codes and Troubleshooting for Upside API](https://docs.upsidemax.xyz/guide/error-codes.md): Reference for HTTP-level error codes and business-level error messages returned by the Upside API, with common troubleshooting guidance. - [Upside API: Perpetuals Trading Guide for Developers](https://docs.upsidemax.xyz/guide/introduction.md): Upside is an action-based perpetuals exchange. The API provides signed writes, unsigned reads, and real-time WebSocket streams for developers. - [Nonce Requirements and Replay Protection on Upside](https://docs.upsidemax.xyz/guide/nonce.md): Understand the nonce field in POST /exchange requests — how to generate it, uniqueness rules, and how it protects against replay attacks. - [Upside API Quickstart: Your First Trade in Python](https://docs.upsidemax.xyz/guide/quickstart.md): Make your first signed Upside API call: generate a wallet, register an account, place a limit order, and cancel it using Python. - [POST /info: Read Query Structure, Types, and Usage](https://docs.upsidemax.xyz/guide/read-requests.md): Query market data, orders, and account state via POST /info. No signing required — just a JSON body with a type field to route the query. - [Upside API Response Formats: Success and Errors](https://docs.upsidemax.xyz/guide/responses.md): Reference for success and error response shapes from POST /exchange and POST /info, including business-level errors inside the statuses array. - [POST /exchange: Write Request Structure and Format](https://docs.upsidemax.xyz/guide/write-requests.md): Understand the envelope structure of POST /exchange requests — action, signature, and nonce fields for all state-changing operations on Upside . - [candleSnapshot: Fetch Historical OHLCV Candle Data](https://docs.upsidemax.xyz/info/candle-snapshot.md): Query historical OHLCV candle data for a contract over any time range, with support for minute, hour, day, week, and month intervals. - [configs: Fetch Market and Contract Configuration Data](https://docs.upsidemax.xyz/info/configs.md): Fetch all coin and contract configuration, including tick sizes, step sizes, leverage tiers, and price/quantity decimal scales for every listed contract. - [l2Book: Fetch Full L2 Order Book Snapshot via REST](https://docs.upsidemax.xyz/info/l2-book.md): Pull a one-time full L2 order book snapshot with all price levels for a contract. For live updates, use the WebSocket l2Book channel instead. - [marketState: Get Current Mark, Index, and Last Price](https://docs.upsidemax.xyz/info/market-state.md): Fetch the current mark price, index price, last trade price, and funding rate index for a contract to align local state on startup or reconnect. - [ordersByCloids: Fetch Orders by Client-Assigned Order ID](https://docs.upsidemax.xyz/info/orders-by-cloids.md): Fetch orders by your client-assigned order IDs for easy reconciliation and status tracking without needing to store exchange-assigned order IDs. - [ordersByIds: Fetch Orders by Exchange-Assigned Order IDs](https://docs.upsidemax.xyz/info/orders-by-ids.md): Fetch one or more orders by their exchange-assigned order IDs to check status, fill details, or confirm cancellation without scanning the full order list. - [POST /info: Upside Read API Overview and Query Types](https://docs.upsidemax.xyz/info/overview.md): All read queries on Upside use a single POST /info endpoint. No authentication required — send a JSON body with a type field to route your query. - [shareGroupState: List Portfolio Share Group Definitions](https://docs.upsidemax.xyz/info/share-group-state.md): Fetch the definitions of portfolio share groups, including contract membership and settlement coin, used by PORTFOLIO margin mode accounts. - [userAccount: Query Account Balances and Open Positions](https://docs.upsidemax.xyz/info/user-account.md): Query your account equity, collateral balances, open positions, and margin availability for a specific market deployer or across all deployers. - [userAgents: List All Authorized API Wallet Agent Slots](https://docs.upsidemax.xyz/info/user-agents.md): List all agent wallets authorized to sign actions on behalf of a master account, including their addresses, names, expiry timestamps, and slot types. - [userMarketDeployers: List Enrolled Market Deployers](https://docs.upsidemax.xyz/info/user-market-deployers.md): Retrieve the list of market deployer IDs your account is currently enrolled in, so you can verify access before trading or transferring collateral. - [userOrders: List All Active Open Orders for an Account](https://docs.upsidemax.xyz/info/user-orders.md): Retrieve all active open orders for your account within a market deployer, with optional filtering by contract ID to narrow results. - [Authenticating a WebSocket Connection on Upside](https://docs.upsidemax.xyz/websocket/authentication.md): Send an Auth message over WebSocket to associate your connection with an account and unlock private channel subscriptions on Upside. - [WebSocket bbo Channel: Best Bid and Ask Price Stream](https://docs.upsidemax.xyz/websocket/bbo.md): Subscribe to bbo over WebSocket for the best bid and ask prices per block — far lower bandwidth than the full l2Book order book channel. - [WebSocket candle Channel: Real-Time OHLCV Bar Updates](https://docs.upsidemax.xyz/websocket/candle.md): Subscribe to the candle WebSocket channel to receive live OHLCV bar updates for a contract at your chosen interval, including closed-bar events. - [WebSocket config: Contract Configuration Notifications](https://docs.upsidemax.xyz/websocket/config.md): Subscribe to the config channel to receive lightweight notifications when contract configuration changes — new listings, freezes, or parameter updates. - [WebSocket l2Book: Real-Time Full Order Book Snapshots](https://docs.upsidemax.xyz/websocket/l2-book.md): Subscribe to l2Book over WebSocket to receive full L2 order book snapshots for any contract on every block — no polling required. - [WebSocket openOrders: Active Orders Snapshot and Updates](https://docs.upsidemax.xyz/websocket/open-orders.md): Subscribe to openOrders to receive a full snapshot of all active orders on subscribe, followed by real-time incremental updates as orders change state. - [WebSocket orderUpdates: Incremental Order State Changes](https://docs.upsidemax.xyz/websocket/order-updates.md): Subscribe to orderUpdates to receive real-time incremental order state changes — new orders, partial fills, cancels, and TP/SL events. - [Upside WebSocket API: Real-Time Data Streaming](https://docs.upsidemax.xyz/websocket/overview.md): Connect to the Upside WebSocket at wss://dev.upsidemax.xyz/ws for real-time order book, trades, candles, and private account updates. - [WebSocket Subscription Protocol for Upside API](https://docs.upsidemax.xyz/websocket/subscription.md): Learn how to subscribe and unsubscribe to WebSocket channels on Upside using the method + subscription object protocol introduced in v0.14. - [WebSocket trades Channel: Real-Time Public Trade Stream](https://docs.upsidemax.xyz/websocket/trades.md): Subscribe to the trades WebSocket channel to receive a real-time stream of all public trades for a contract as they execute on-chain. - [WebSocket userFills: Real-Time Personal Fill Stream](https://docs.upsidemax.xyz/websocket/user-fills.md): Subscribe to userFills to receive every fill involving your orders in real time — whether you were the taker aggressor or the resting maker.