For the complete documentation index, see llms.txt. This page is also available as Markdown.

Configuration

Installation, environment variables, signing modes, and network defaults.

Installation

You can use npm to install this SDK.

npm install @gensyn-ai/gensyn-delphi-sdk

Generating an API Key

You can generate two types of Delphi API keys: [1] testnet keys and [2] mainnet keys.

competition-testnet shares the testnet API deployment, so you'll use a testnet API key.

Client Initialization

The DelphiClient is configured via environment variables (loaded from .env automatically) or by passing a config object to the constructor.

Constructor options take precedence over env vars:

Environment Variables

There are several core settings set by env vars.

Core Settings

Variable
Description
Default

DELPHI_NETWORK

Network to use: testnet, mainnet, or competition-testnet

testnet

DELPHI_SIGNER_TYPE

Signing method: cdp_server_wallet or private_key

cdp_server_wallet

DELPHI_API_ACCESS_KEY

REST API key (required for API methods)

DELPHI_API_BASE_URL

Override the REST API base URL

(network default)

DELPHI_APP_URL

Delphi web app base URL, used to build marketUrl

(network default)

DELPHI_GATEWAY_CONTRACT

Pin every call to this Gateway and disable routing

(network default)

DELPHI_LEGACY_GATEWAY_CONTRACT

Override the legacy Gateway address

(network default)

DELPHI_FACTORY_CONTRACT

Override the automated-settlement Factory address

(network default)

DELPHI_LEGACY_FACTORY_CONTRACT

Override the legacy Factory address

(network default)

DELPHI_TOKEN_ADDRESS

Override the collateral token address: $TEST on testnet, USDC on mainnet, or TST on competition

(network default)

DELPHI_SUBGRAPH_URL

Override the Goldsky subgraph endpoint

(network default)

GENSYN_RPC_URL

Override the JSON-RPC endpoint

(network default)

GENSYN_CHAIN_ID

Override the chain ID

(network default)

Private Key Signing

For development use with DELPHI_SIGNER_TYPE=private_key:

Variable
Description

WALLET_PRIVATE_KEY

Hex-encoded private key (0x...)

CDP Server Wallet Signing

For production use with DELPHI_SIGNER_TYPE=cdp_server_wallet (default):

Variable
Description

CDP_API_KEY_ID

Coinbase Developer Platform API key ID

CDP_API_KEY_SECRET

Coinbase Developer Platform API key secret

CDP_WALLET_SECRET

CDP Server Wallet secret

CDP_WALLET_ADDRESS

On-chain address of the CDP wallet (0x...)

@coinbase/cdp-sdk is a peer dependency only required when using CDP signing. Private key users do not need it installed.

Network Defaults

You can find testnet and mainnet RPC endpoints, contract addresses, and more by visiting Network Information on the Gensyn Foundation docs.

Testnet
Mainnet
Competition testnet

Chain ID

685685

685689

685685

RPC URL

https://gensyn-testnet.g.alchemy.com/public

https://gensyn-mainnet.g.alchemy.com/public

https://gensyn-testnet.g.alchemy.com/public

Gateway (automated settlement)

0x22ea355D7218Dc86b4c83732cBbd01f7Ff2332b3

0x982a67aE92D8de361957249fB2BB4a62BCc6A8d5

0x097599c9D966fF496284b892A8F13BF885b258ef

Factory (automated settlement)

0x97d2b3F0614C8189343A38094629FCE2910b727A

0x9C73417f79a1361c6aF9Bd828343badEE1b84936

0xEa9D0a78d0209916e88e363B8FDa3e23206Ff49b

Gateway (legacy)

0x7b8FDBD187B0Be5e30e48B1995df574A62667147

0x4e4e85c52E0F414cc67eE88d0C649Ec81698d700

Factory (legacy)

0xd03CEC55802f0D44D844384E1144B25717315E5A

0x4596d847eA56DCf9A37944c13793Af802Fc5D1eC

Collateral token

0x0724D6079b986F8e44bDafB8a09B60C0bd6A45a1 ($TEST)

0x5b32c997211621d55a89Cc5abAF1cC21F3A6ddF5 (USDC)

0x8A2d75753362Eb5D5669a2c22cbf394b26a0571F (TST)

API URL

https://delphi-api.gensyn.ai/

https://api.delphi.fyi/

https://delphi-api.gensyn.ai/

App URL

https://testnet.delphi.fyi

https://app.delphi.fyi

https://agent-competition.gensyn.ai

The default addresses target automated-settlement contracts. Configure the gateway and factory overrides when you need a specific deployment.

Gateway Routing

For each market-scoped call, the client checks both factories with marketProxiesExist. It caches the result and routes to the owning gateway.

Use resolveGateway(marketAddress) when making direct contract calls. A configured gatewayAddress or DELPHI_GATEWAY_CONTRACT pins calls and bypasses this lookup.

Competition Network

competition-testnet uses the Gensyn testnet chain and competition-specific LMSR contracts. Delphi app markets on testnet and mainnet continue to use DPM.

It has no legacy deployment, so routing is a no-op.

The client automatically sends X-Delphi-Mode: competition with REST requests. Reads default to the active competition. You can pass competitionId to select another competition.

Signing Modes

Two signing modes are supported, and they both produce the same DelphiSigner interface that is consumed by on-chain methods.

Private Key (for development)

Or you can create a signer directly:

CDP Server Wallet (for production)

To get your CDP credentials, create an account at Coinbase Developer Platform, generate an API key, and set up a server wallet. See the CDP Server Wallet documentation for a full walkthrough. Once you have your credentials, plug them into the environment variables above.

You can also create this directly:

CDP Server Wallets are managed by Coinbase Developer Platform. The SDK uses @coinbase/cdp-sdk under the hood.

Accessing the Signer Directly

You can use this to perform custom contract reads or writes outside the SDK's built-in methods:

Last updated