Integration Spec

HedgeFi Trading API Documentation

Base URL: https://dex.hedgefi.io/trading

Open Trade

Endpoint: POST /api/v1/trades/open

Opens a new trading position. Supports both market orders (immediate execution) and limit orders (execution at specified price).

Request Headers

Content-Type: application/json

Request Body Parameters

Parameter
Type
Required
Description

api_key

string

Yes

Your API key

api_secret

string

Yes

Your API secret

wallet_address

string

Yes

Ethereum wallet address (0x...)

asset

string

Yes

Asset symbol (e.g., "BTC", "ETH")

direction

string

Yes

Trade direction: "LONG" or "SHORT"

pair_index

integer

Yes

Pair index (see supported pairs below)

collateral

float

Yes

Collateral amount in USDC

take_profit_percentage

float

Yes

Take profit percentage (e.g., 20.0 for 20%)

stop_loss_percentage

float

Yes

Stop loss percentage (e.g., 10.0 for 10%)

leverage

integer

Yes

Leverage multiplier (1-100)

order_type

string

No

Order type: "MARKET" (default) or "LIMIT"

limit_price

float

No

Limit price (required if order_type is "LIMIT")


Market Order (Default)

Opens a trade immediately at the current market price.

Example Request

cURL Example

Example Response


Limit Order

Opens a trade only when the price reaches your specified limit price.

Example Request

cURL Example

Example Response


Supported Assets & Pair Indices

CRYPTO

Pair Index
Pair
Asset Symbol

0

BTC/USD

BTC

1

ETH/USD

ETH

2

LINK/USD

LINK

3

DOGE/USD

DOGE

5

ADA/USD

ADA

7

AAVE/USD

AAVE

8

ALGO/USD

ALGO

11

DOT/USD

DOT

13

LTC/USD

LTC

18

XLM/USD

XLM

19

XRP/USD

XRP

20

ZEC/USD

ZEC

33

SOL/USD

SOL

47

BNB/USD

BNB

102

AVAX/USD

AVAX

103

ATOM/USD

ATOM

104

NEAR/USD

NEAR

105

QNT/USD

QNT

107

TON/USD

TON

109

ARB/USD

ARB

131

CAKE/USD

CAKE

134

PEPE/USD

PEPE

136

GMX/USD

GMX

137

FIL/USD

FIL

138

APT/USD

APT

139

IMX/USD

IMX

140

VET/USD

VET

141

OP/USD

OP

142

RNDR/USD

RNDR

143

EGLD/USD

EGLD

144

TIA/USD

TIA

320

PENGU/USD

PENGU

321

FARTCOIN/USD

FARTCOIN

331

HYPE/USD

HYPE

414

ASTER/USD

ASTER

FOREX

Pair Index
Pair
Asset Symbol

21

EUR/USD

EURUSD

22

USD/JPY

USDJPY

23

GBP/USD

GBPUSD

26

USD/CAD

USDCAD

29

EUR/JPY

EURJPY

110

EUR/AUD

EURAUD

112

EUR/CAD

EURCAD

115

GBP/CAD

GBPCAD

117

GBP/JPY

GBPJPY

119

AUD/CAD

AUDCAD

121

AUD/JPY

AUDJPY

124

NZD/JPY

NZDJPY

126

CAD/JPY

CADJPY

COMMODITIES

Pair Index
Pair
Asset Symbol

90

XAU/USD

XAU

91

XAG/USD

XAG


Error Responses

Invalid Request

Insufficient Balance

Invalid API Credentials


Notes

  • All amounts are in USDC

  • Leverage must be between 1 and 100

  • Take profit and stop loss percentages are relative to entry price

  • Market orders execute immediately at current market price

  • Limit orders remain pending until price reaches limit_price

  • Pair index must match the asset symbol provided

Last updated