SDKs
JavaScript/Typescript
Admin Methods
Groups
Spread Groups

Spread Groups

Spread groups are a type of group which determine the spreads which will apply to any particular account.

Listing Spread Groups

To list spread groups for a particular project the list() method under the admin.spreadGroup namespace in the SDK should be used:

ℹ️

Note that for MetaTrader, the UserGroup and the SpreadGroup are one and the same.

import { SpreadGroupDto } from '@tradrapi/trading-sdk';
 
const result: SpreadGroupDto[] = await tradrApi.admin.speadGroup.list();

The response of the above is in the form of an array of SpreadGroupDto models, each of which with an interface as follows:

export interface SpreadGroupDto {
  /** The TradrAPI id of the spread group */
  id: number;
  /** The name of the spread group */
  name: string;
  /** The trading platform the spread group belongs to */
  platform: 'MT4' | 'MT5' | 'TL' | 'TE' | 'TT';
  /** The id of the spread group as it exists on the trading platform */
  platformGroupId: string;
  /** The TradrAPI server id the spread group belongs to */
  serverId: number;
  /** The monetization type of the server the spread group exists on */
  serverType: 'demo' | 'real' | 'mixed' | 'margin';
}