> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decibel.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Network presets and configuration for the Decibel TypeScript SDK

## DecibelConfig

* network: Aptos network identifier
* fullnodeUrl: Aptos fullnode HTTP endpoint
* tradingHttpUrl: Decibel trading REST base URL
* tradingWsUrl: Decibel trading WebSocket URL
* gasStationUrl: Base URL override for the Gas Station API (only needed for custom networks)
* gasStationApiKey: [Geomi Gas Station](/quickstart/gas-station) API key for sponsored transactions
* deployment: on-chain package and addresses (package, usdc, testc, perpEngineGlobal)
* chainId: optional preconfigured chain id to accelerate build/sign

## Custom config example

```ts theme={null}
import { type DecibelConfig } from "@decibeltrade/sdk";
import { Network } from "@aptos-labs/ts-sdk";

const CUSTOM: DecibelConfig = {
  network: Network.CUSTOM,
  fullnodeUrl: "https://fullnode.example.com/v1",
  tradingHttpUrl: "https://api.example.com/decibel",
  tradingWsUrl: "wss://api.example.com/decibel/ws",
  gasStationUrl: "https://api.example.com/gs/v1", // optional: enables gas sponsorship
  gasStationApiKey: process.env.GAS_STATION_API_KEY, // optional: enables gas sponsorship
  deployment: {
    package: "0x...package",
    usdc: "0x...usdc",
    testc: "0x...testc",
    perpEngineGlobal: "0x...global",
  },
  chainId: 204, // optional
};
```

## Gas Station (Sponsored Transactions)

To sponsor gas fees for your users via [Geomi Gas Station](/quickstart/gas-station), add `gasStationApiKey` to your config:

```ts theme={null}
const config = {
  ...TESTNET_CONFIG,
  gasStationApiKey: process.env.GAS_STATION_API_KEY!,
};

const write = new DecibelWriteDex(config, account);
```

When `gasStationApiKey` is set, the SDK automatically submits all transactions through the Gas Station for fee sponsorship. Users don't need APT for gas. To disable sponsorship, simply omit `gasStationApiKey` from the config.

## Node API keys

Pass `nodeApiKey` to `DecibelReadDex` or `DecibelWriteDex` for fullnode rate limits and performance.\
Under the hood, the SDK sends it as `Authorization: Bearer <YOUR_NODE_API_KEY>` on outbound HTTP requests:

```ts theme={null}
const read = new DecibelReadDex(NETNA_CONFIG, {
  nodeApiKey: process.env.APTOS_NODE_API_KEY!, // Required
});
const write = new DecibelWriteDex(NETNA_CONFIG, account, {
  nodeApiKey: process.env.APTOS_NODE_API_KEY!, // Required
});
```
