Configuration

Everything TriaClient accepts, plus the environment knob that selects which Tria builder fees route to.

TriaClientConfig

type TriaClientConfig = {
  network?: 'mainnet' | 'staging' // DEPRECATED — use `development`.
  development?: boolean // true → Tria's dev builder/treasury (still mainnet). Default false.
  hl?: HlConfig
  decibel?: DecibelConfig
}

type HlConfig = {
  agentPrivateKey: string // 0x + 64 hex (secp256k1)
  accountAddress: string // 0x + 40 hex (EVM)
}

type DecibelConfig = {
  delegatePrivateKey?: string // 0x + 64 hex (Ed25519) or AIP-80. OMIT for read-only.
  aptosOwnerAddress?: string // master Aptos wallet — SDK derives the primary subaccount
  subaccountAddress?: string // DEPRECATED: legacy fallback; must match the derived primary
  nodeApiKey?: string // Geomi Api key for reads (required when decibel is set)
  gasStation?: string // Geomi Gs key for sponsored writes
}
  • Both hl and decibel are independently optional. A client built with only hl works for HL; calling a Decibel method throws TriaError(INVALID_ARGUMENT).
  • Agent / delegate keys accept any common format: raw 0x… hex, AIP-80 ed25519-priv-0x…, or unprefixed hex. Aptos addresses can be AIP-40 short or long; the SDK canonicalizes to long internally.
  • Builder addresses + fee values are hardcoded per network and are not user-configurable. See Errors & attribution.

Read-only Decibel client

delegatePrivateKey is optional. A decibel block with just { nodeApiKey } serves public market data (markets, ticker, orderbook, candles, recentTrades) with no trading credentials. Add aptosOwnerAddress to also read private account state (positions, balances, account, openOrders, fills).

// Public market data only — no trading credentials.
const md = new TriaClient({
  decibel: { nodeApiKey: process.env.TRIA_TRADE_DECIBEL_NODE_API_KEY! },
})
await md.ticker({ venue: 'decibel', market: 'BTC/USD' })

Calling a trading method on a read-only client throws TriaError(CONFIG) with a clear pointer to add delegatePrivateKey.

Builder environment

Both venues always trade on real mainnet markets. The only knob is which Tria builder/treasury the fees route to:

  • Name
    (default)
    Type
    production
    Description

    Leave development unset / false. This is what external operators use.

  • Name
    development: true
    Type
    env TRIA_TRADE_DEVELOPMENT=true
    Description

    Tria's development builder/treasury — internal integration testing against real venues. Fees route to a separate treasury.

There is no testnet targetdevelopment does not change the venue, only the builder address.

Environment variables

The canonical TRIA_TRADE_* registry, shared by the SDK, the MCP server, the provisioning wizard, and the in-app export — so the same .env works everywhere.

VariableForNotes
TRIA_TRADE_NETWORKbothmainnet (default). staging is a deprecated alias for TRIA_TRADE_DEVELOPMENT=true.
TRIA_TRADE_DEVELOPMENTbothtrue → dev builder.
TRIA_TRADE_HL_AGENT_KEYHLscoped agent key (not your main wallet key).
TRIA_TRADE_HL_ACCOUNT_ADDRESSHLHL master EVM address.
TRIA_TRADE_DECIBEL_DELEGATE_KEYDecibelscoped Ed25519 delegate key.
TRIA_TRADE_DECIBEL_APTOS_OWNER_ADDRESSDecibelmaster Aptos address (SDK derives the subaccount).
TRIA_TRADE_DECIBEL_NODE_API_KEYDecibelGeomi Api key — required for reads.
TRIA_TRADE_DECIBEL_GAS_STATION_KEYoptionalGeomi Gs key — sponsored writes.
TRIA_TRADE_CLIENT_IDoptionalTelemetry attribution identity. Omit → anonymous.
TRIA_TRADE_TELEMETRYoptional0 to opt out of usage telemetry (default on).
TRIA_TRADE_TELEMETRY_ENDPOINToptionalOverride the telemetry proxy URL.

See Telemetry & privacy for what's collected and how to opt out.

Was this page helpful?