Skip to main content

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 API key for sponsored transactions
  • gasStationAddress: on-chain fee-payer address of that Gas Station; only required for encrypted submission
  • deployment: on-chain package and addresses (package, predepositPackage, campaignPackage, usdc, testc, perpEngineGlobal, dlpVault, dlpShare; fftCampaignAddr optional)
  • chainId: optional preconfigured chain id to accelerate build/sign

Custom config example

Gas Station (Sponsored Transactions)

To sponsor gas fees for your users via Geomi Gas Station, add gasStationApiKey to your config:
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.

Encrypted submission

Pass defaultEncrypted: true to DecibelWriteDex to submit front-run-sensitive writes as encrypted pending transactions. The flag is exposed as a readonly property on the instance, and submission still downgrades to plaintext when the fullnode exposes no encryption key. An encrypted transaction bakes the literal fee-payer address into its payload at build time, so a Gas Station can only sponsor one when gasStationAddress is also set. Use configSupportsEncryptedSubmission(config) to check that before promising the user encryption:

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: