API Reference

/userPosition

Retrieves user current open position on the exchange

Log in to see full request history
timestatususer agent
Retrieving recent requests…
LoadingLoading…

Client Library

import { BluefinClient, Networks, MARKET_SYMBOLS } from "@bluefin-exchange/bluefin-v2-client"; async function main() { const dummyAccountKey = "trigger swim reunion gate hen black real deer light nature trial dust"; const client = new BluefinClient( true, Networks.TESTNET_SUI, dummyAccountKey, "ED25519" ); await client.init(); // fetch only BTC-PERP position const resp = await client.getUserPosition({ symbol: MARKET_SYMBOLS.BTC }); console.log(resp.data); } main().then().catch(console.warn);
from config import TEST_ACCT_KEY, TEST_NETWORK from bluefin_v2_client import BluefinClient, Networks, MARKET_SYMBOLS, TRADE_TYPE, Interval from pprint import pprint import asyncio async def main(): client = BluefinClient(True, Networks[TEST_NETWORK], TEST_ACCT_KEY) await client.init(True) # gets user current position in a specified Market position = await client.get_user_position({"symbol":MARKET_SYMBOLS.ETH}) pprint(position) # to retrieve all currently opened positions call the function without the symbol: client.get_user_position({}) await client.close_connections() if __name__ == "__main__": loop = asyncio.new_event_loop() loop.run_until_complete(main()) loop.close()

HTTPs

Alternatively, if you have obtained your auth token, call the GET /userPosition endpoint using the integrated editor on the right or locally from any language supporting HTTPs network calls.

Request & Response

Query Params
string

Market symbol for which the user wishes to get its open position.
If not provided then will return open position across all markets

string

Provide if fetch positions as a subaccount

double
Defaults to 50

Number of records required per page.
The exchange server allows a maximum of 50 records per trade.
If the total markets are 75 and the user has open positions across all of them,
the returned response will only contain 50 open positions

double
Defaults to 1

Fetches open positions from a particular page number.
Per page, there are 50 records, so if a user has 100 open positions across 100 markets,
he must call the method twice with page numbers 1 and 2 to get all 100 positions

Responses

400
Language
Credentials
Click Try It! to start a request and see the response here! Or choose an example:
application/json