Skip to main content

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.

This page provides the contract addresses and common helper functions you’ll need when building transactions directly.

Package Address

All Decibel transactions use the following package address:
0x50ead22afd6ffd9769e3b3d6e0e64a2a350d68e8b102c4e72e33d0b8cfdfdb06

Helper Functions

Get Market Address

import {
  AccountAddress,
  createObjectAddress,
  MoveString,
} from "@aptos-labs/ts-sdk";

function getMarketAddr(
  marketName: string,
  perpEngineGlobal: string
): AccountAddress {
  const marketNameBytes = new MoveString(marketName).bcsToBytes();
  return createObjectAddress(
    AccountAddress.fromString(perpEngineGlobal),
    marketNameBytes
  );
}

Get Perp Engine Global Address

import { AccountAddress, createObjectAddress } from "@aptos-labs/ts-sdk";

function getPerpEngineGlobalAddress(packageAddress: string): AccountAddress {
  return createObjectAddress(
    AccountAddress.fromString(packageAddress),
    new TextEncoder().encode("GlobalPerpEngine")
  );
}

Optimized Building

Build transactions synchronously for better performance

Formatting Prices & Sizes

Convert decimal values to chain units