sFOX API
Sign InOpen Account
sFOX API
sFOX API
  • Introduction
    • Welcome
    • Getting Started
    • Systems & Operations
    • Rate Limits
  • REST API
    • REST Endpoints
    • Authentication
    • Rate Limits
    • Account Management
      • Get All Balances
      • Get All Currencies
      • Get All Currency Pairs
      • Get All Transactions
      • Get Fees
    • Orders
      • Order Types
      • Create Order
      • Cancel Order
      • Cancel Multiple Orders
      • Cancel All Orders
      • Amend Order
      • Get Single Order
      • Get All Open Orders
      • Get All Done Orders
      • Get All Trades
    • Request for Quote (RFQ)
    • Post-Trade Settlement (PTS)
      • Get Account Risk Metrics
      • Get All Positions
      • Get All Funding Transactions
      • Get All Funding Rates
      • Get All Risk Modes
      • Create Transfer
    • Shorting
      • Get Account Risk Metrics
      • Get All Positions
    • Transfers
      • Get All Deposit Addresses
      • Get Single Deposit Address
      • Create Deposit Address
      • Deposit From Bank Account
      • Withdraw From Account
      • Get Single Withdrawal Fee
      • Create Transfer
    • Custody (sFOX SAFE)
      • Get Whitelisted Addresses
      • Add Whitelisted Address
      • Delete Whitelisted Address
      • Get Approval Rules
      • Create Approval Rule
      • Edit Approval Rule
      • Get Approval Requests
      • Respond to Approval Request
    • Staking
      • Get Staking Currencies
      • Get All Staking Transactions
      • Create Stake
      • Cancel Stake
      • Unstake
    • Market Data
      • Get Candlesticks
      • Get Volume Analytics
      • Get Order Estimate
      • Get Order Book
    • Reporting
      • Get Orders Report
      • Get Monthly Summary
      • Get Portfolio Valuation
      • Get All Transactions
  • WebSocket API
    • Introduction
    • Connecting
    • Rate Limits
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • Market Data
      • Order Book
      • Trades
      • Ticker
    • Orders & Account Data
      • Orders
      • Trades
      • Balances
      • Post-Trade Settlement
  • FIX API
    • FIX Order Entry
    • FIX Market Data
    • QuickFIX Guide
  • Errors
    • Error Codes
Powered by GitBook
  1. REST API
  2. Post-Trade Settlement (PTS)

Create Transfer

POST https://api.sfox.com/v1/account/transfer

Transfer funds between your account's trading and collateral wallets.

Hedge long positions: Transfer funds to your collateral wallet so you can open a short position on the same currency in your trading wallet.

Transfers from your collateral wallet to your trading wallet will automatically settle unsettled positions, if applicable, first. The remainder, if any, will be applied to your trading wallet.

Body Parameters

Name
Type
Description

currency required

String

Currency to be transferred

quantity required

String

Quantity to be transferred

from_wallet required

String

Wallet being transferred from. Possible values: trading: your account's trading wallet collateral: your account's collateral wallet

to_wallet required

String

Wallet being transferred to. Possible values: trading: your account's trading wallet collateral: your account's collateral wallet

Response Body

Key
Description

from_transaction_id

sFOX generated ID of the transaction debiting the source wallet of the transfer

to_transaction_id

sFOX generated ID of the transaction crediting the destination wallet of the transfer

currency

Currency that was transferred

quantity

Quantity of the currency that was transferred

from_wallet

Name of the source wallet (trading or collateral)

to_wallet

Name of the destination wallet (trading or collateral)

Responses

200
{
    "from_transaction_id": 5467771,
    "to_transaction_id": 5467772,
    "currency": "btc",
    "quantity": 1,
    "from_wallet": "trading",
    "to_wallet": "collateral"
}

Example Requests

curl -H 'Authorization: Bearer <API_TOKEN>' \
-H 'Content-Type: application/json' \
-X POST \
--data '{"currency": "btc", "quantity": "1", "from_wallet": "trading", "to_wallet": "collateral"}' \
https://api.sfox.com/v1/account/transfer
const axios = require('axios');

axios({
  method: 'post',
  url: 'https://api.sfox.com/v1/account/transfer',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  },
  data: { 
    currency: 'btc',
    quantity: 1,
    from_wallet: 'trading',
    to_wallet: 'collateral'
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
import requests

data = requests.post(
  "https://api.sfox.com/v1/account/transfer",
  headers={
    "Authorization": "Bearer <API_KEY>",
  },
  data={
    "currency": "btc",
    "quantity": 1,
    "from_wallet": "trading",
    "to_wallet": "collateral"
  }
)
print(data)
PreviousGet All Risk ModesNextShorting

Last updated 1 year ago