Skip to content

Configuration

Configuration object is consumed by Symphony SDK. You can partially or completely modify it to your needs.

Overview

Viem
const defaultConfig = {
  timeout: 10000,
  chainId: 1329,
  chainName: "sei",
  rpcUrl: "https://sei-rpc.publicnode.com",
  nativeAddress: "0x0",
  wrappedNativeAddress: "0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7",
  slippage: "0.5",
  publicClient: publicClient,
  tokens: TokenListByAddress,
  additionalTokens: {},
  overrideDefaultTokens: false,
  feeParams: {
    paramFee: "0",
    feeAddress: "0x0000000000000000000000000000000000000000",
    feeSharePercentage: "0",
  },
};

Parameters

timeout

  number

Timeout time for route calls

chainId

  string

Chain Id that Symphony operates on.

chainName

  string

Chain Name that Symphony operates on.

rpcUrl

  string

Rpc Url that Symphony uses to create public provider/client.

nativeAddress

  string

Address for Symphony to refer native token internally. Default is '0x0'.

slippage

  string | number

Slippage percentage Symphony uses internally. You can always override slippage amount while using 'swap'. Refer to 'slippage' section for details.

provider / publicClient

  string

Public Client / Provider Symphony uses to do read calls, transaction simulations

tokens

  array

Token list of Symphony Aggregator. Returns tokens depending on chainId.

additionalTokens

  object

An object where keys are token addresses and values are token data objects. This allows you to add custom tokens to the default token list. Symphony will merge these tokens with its default list. Each token object must adhere to the required structure, including id, attributes (with address, name, symbol, decimals, and logoUrl). All token addresses are automatically normalized to lowercase.

Example:

additionalTokens: {
  "0x1234567890abcdef1234567890abcdef12345678": {
    id: "sei_0x1234567890abcdef1234567890abcdef12345678", // has to be in sei_[address] format
    attributes: {
      address: "0x1234567890abcdef1234567890abcdef12345678",
      name: "Custom Token 1",
      symbol: "CTK1",
      decimals: 18,
      logoUrl: "https://example.com/ctk1.png"
    }
  }
}

overrideDefaultTokens

  boolean

When set to true, Symphony will use only the tokens provided in additionalTokens, completely ignoring its default token list. If additionalTokens is not provided or is empty, and overrideDefaultTokens is true, the token list will be empty. Defaults to false.

Example (using only custom tokens):

overrideDefaultTokens: true,
additionalTokens: {
  "0xabcdef1234567890abcdef1234567890abcdef12": {
    id: "my_exclusive_token",
    attributes: {
      address: "0xabcdef1234567890abcdef1234567890abcdef12",
      name: "My Exclusive Token",
      symbol: "MET",
      decimals: 6,
      logoUrl: "https://example.com/met.png"
    }
  }
}

feeParams

  object

feeParams structure for executeSwaps function of Symphony contract. Used for split fees. Deactive by default.

  • paramFee - Custom fee amount that will override platform fees. Represents a percentage in bps and should be between 1 and 1000. 100% = 1000.
  • feeAddress - Receiver address of custom fee.
  • feeSharePercentage - Percentage of split between Symphony and user.

feeAddress being zero address disables custom fee behavior.