Skip to main content
PATCH
Update stop loss, take profit, leverage or collateral

Authorizations

X-Gains-Signature
string
header
required

EIP-712 signature by an authorised agent over {method, path, body, timestamp, nonce}, sent with X-Gains-Agent, X-Gains-Timestamp and X-Gains-Nonce.

Path Parameters

chain
enum<string>
required
Available options:
arbitrum,
base,
polygon,
megaeth,
arbitrum-sepolia
Example:

"arbitrum"

id
string
required
Example:

"5316911983139663"

Body

application/json

Fields to change

sl
string

Decimal number encoded as a string to preserve precision.

Pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
Example:

"0.5"

tp
string

Decimal number encoded as a string to preserve precision.

Pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
Example:

"0.5"

leverage
string

Decimal number encoded as a string to preserve precision.

Pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
Example:

"0.5"

collateral
object

Add or remove collateral while keeping the position size (adjusts leverage).

Response

The updated position

position
object
required
transaction
object
required

A transaction for the agent to sign and broadcast: the Diamond as to, zero value, no sender or nonce (the wallet fills them).