Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pacifica-fi/docs-migrate/llms.txt

Use this file to discover all available pages before exploring further.

The Account endpoints provide full visibility into a trader’s state on Pacifica, from high-level equity and positions to granular balance events and spot asset management. All read-only (GET) endpoints require only the account query parameter; all mutating (POST) endpoints require a cryptographic signature.
All POST endpoints on this page require request signing. See the Authentication guide for details.

GET /api/v1/account — Get Account Info

Returns high-level account data: balance, fee tier, equity, margin usage, open position and order counts, and per-asset spot balances. Request
account
string
required
Account wallet address.
curl "https://api.pacifica.fi/api/v1/account?account=42trU9A5..."
Response
{
  "success": true,
  "data": {
    "balance": "2000.000000",
    "fee_level": 0,
    "maker_fee": "0.00015",
    "taker_fee": "0.0004",
    "account_equity": "2150.250000",
    "available_to_spend": "1800.750000",
    "available_to_withdraw": "1500.850000",
    "pending_balance": "0.000000",
    "pending_interest": "0.000000",
    "spot_collateral": "0.000000",
    "cross_account_equity": "2100.500000",
    "spot_market_value": "250.000000",
    "total_margin_used": "349.500000",
    "cross_mmr": "420.690000",
    "positions_count": 2,
    "orders_count": 3,
    "stop_orders_count": 1,
    "updated_at": 1716200000000,
    "spot_balances": [
      {
        "symbol": "SOL",
        "amount": "1.50000000",
        "available_to_withdraw": "1.00000000",
        "pending_balance": "0.50000000",
        "daily_withdraw_amount_usd": "250.000000",
        "effective_daily_deposit_limit_usd": "50000.000000",
        "effective_daily_withdraw_limit_usd": "250000.000000"
      }
    ]
  },
  "error": null,
  "code": null
}
balance
decimal string
Account balance in USD before settlement.
fee_level
integer
Current fee tier, determined by trading volume.
maker_fee
decimal string
Current maker fee rate.
taker_fee
decimal string
Current taker fee rate.
account_equity
decimal string
Balance + unrealized PnL + isolated margin + raw spot market value.
available_to_spend
decimal string
Equity available to margin new positions and orders.
available_to_withdraw
decimal string
Amount available for withdrawal.
pending_balance
decimal string
Balance pending deposit confirmation.
pending_interest
decimal string
Accrued loan interest not yet repaid.
spot_collateral
decimal string
Total USD value of spot assets used as unified margin collateral.
cross_account_equity
decimal string or null
Cross-margin equity after unified-margin collateral rules. null if not applicable.
spot_market_value
decimal string
Raw marked-to-market value of positive spot balances before haircuts.
total_margin_used
decimal string
Equity currently used to margin open positions and orders.
cross_mmr
decimal string
Maintenance margin required under cross margin mode.
positions_count
integer
Number of open positions (isolated and cross).
orders_count
integer
Number of open orders across all markets (excludes stop orders).
stop_orders_count
integer
Number of open stop orders.
updated_at
integer
Timestamp (ms) of the last account update.
spot_balances
array
Per-asset spot balances.

GET /api/v1/account/settings — Get Account Settings

Returns account-level margin mode and leverage settings that differ from their defaults. Upon account creation all markets default to cross margin with maximum leverage; markets with default settings are not returned. Request
account
string
required
Account wallet address.
curl "https://api.pacifica.fi/api/v1/account/settings?account=42trU9A5..."
Response
{
  "success": true,
  "data": {
    "auto_lend_disabled": null,
    "margin_settings": [
      {
        "symbol": "WLFI",
        "isolated": false,
        "leverage": 5,
        "created_at": 1758085929703,
        "updated_at": 1758086074002
      }
    ],
    "spot_settings": [
      {
        "symbol": "SOL",
        "unified_margin_excluded": false
      }
    ],
    "error": null,
    "code": null
  }
}
auto_lend_disabled
boolean or null
Whether automatic lending is disabled. null means the default (enabled).
margin_settings
array
Non-default margin and leverage settings per symbol.
spot_settings
array
Per-asset spot settings for unified margin.

POST /api/v1/account/leverage — Update Leverage

Changes the leverage setting for a specific trading pair. For symbols with open positions, leverage can only be increased.
This endpoint requires a signed request. Set the type header field to "update_leverage". See Authentication.
Request
account
string
required
User’s wallet address.
signature
string
required
Cryptographic signature.
timestamp
integer
required
Current timestamp in milliseconds.
symbol
string
required
Trading pair symbol.
leverage
integer
required
New leverage value.
agent_wallet
string
Agent wallet address.
expiry_window
integer
Signature expiry in milliseconds.
{
  "account": "42trU9A5...",
  "signature": "5j1Vy9UqY...",
  "timestamp": 1716200000000,
  "symbol": "BTC",
  "leverage": 10,
  "expiry_window": 30000
}
Response
{
  "success": true
}

POST /api/v1/account/margin — Update Margin Mode

Switches between isolated and cross margin modes for a specific trading pair. Cannot be changed while a position is open on that symbol.
This endpoint requires a signed request. Set the type header field to "update_margin_mode". See Authentication.
Request
account
string
required
User’s wallet address.
signature
string
required
Cryptographic signature.
timestamp
integer
required
Current timestamp in milliseconds.
symbol
string
required
Trading pair symbol.
is_isolated
boolean
required
true for isolated margin, false for cross margin.
agent_wallet
string
Agent wallet address.
expiry_window
integer
Signature expiry in milliseconds.
{
  "account": "42trU9A5...",
  "signature": "5j1Vy9Uq...",
  "timestamp": 1716200000000,
  "symbol": "BTC",
  "is_isolated": false,
  "expiry_window": 30000
}
Response
{
  "success": true
}

GET /api/v1/positions — Get Positions

Returns all currently open positions for a given account. Request
account
string
required
Account wallet address.
curl "https://api.pacifica.fi/api/v1/positions?account=42trU9A5..."
Response
{
  "success": true,
  "data": [
    {
      "symbol": "AAVE",
      "side": "ask",
      "amount": "223.72",
      "entry_price": "279.283134",
      "margin": "0",
      "funding": "13.159593",
      "isolated": false,
      "liquidation_price": null,
      "created_at": 1754928414996,
      "updated_at": 1759223365538
    }
  ],
  "error": null,
  "code": null,
  "last_order_id": 1557431179
}
symbol
string
Trading pair symbol.
side
string
"bid" (long) or "ask" (short).
amount
decimal string
Position size in the asset’s base unit.
entry_price
decimal string
VWAP entry price of the position.
margin
decimal string
Margin allocated to an isolated position. Only populated for isolated positions.
funding
decimal string
Cumulative funding paid since the position was opened, in USD.
isolated
boolean
Whether the position uses isolated margin.
liquidation_price
decimal string or null
Estimated liquidation price. null if not applicable.
created_at
integer
Timestamp (ms) when the position was opened.
updated_at
integer
Timestamp (ms) of the last position update.
last_order_id
integer
Exchange-wide sequential nonce for reliable event ordering.

GET /api/v1/trades/history — Get Trade History

Returns paginated trade history for an account, optionally filtered by symbol and time range. Request
account
string
required
User’s wallet address.
symbol
string
Filter by market symbol, e.g. BTC.
start_time
integer
Start time in milliseconds.
end_time
integer
End time in milliseconds.
limit
integer
Maximum records to return. Defaults to 100.
cursor
string
Pagination cursor.
curl "https://api.pacifica.fi/api/v1/trades/history?account=42trU9A5...&symbol=BTC&limit=20"
Response
{
  "success": true,
  "data": [
    {
      "history_id": 19329801,
      "order_id": 315293920,
      "client_order_id": "acf...",
      "symbol": "LDO",
      "amount": "0.1",
      "price": "1.1904",
      "entry_price": "1.176247",
      "fee": "0",
      "pnl": "-0.001415",
      "event_type": "fulfill_maker",
      "side": "close_short",
      "created_at": 1759215599188,
      "cause": "normal"
    }
  ],
  "next_cursor": "11111Z5RK",
  "has_more": true
}
history_id
integer
Unique ID for this trade event.
order_id
integer
Order that resulted in this trade.
client_order_id
string or null
Client-defined UUID if provided.
symbol
string
Trading pair symbol.
amount
decimal string
Trade size in base units.
price
decimal string
Current market price at event time.
entry_price
decimal string
Price at which the trade was executed.
fee
decimal string
Fee paid in USD.
pnl
decimal string
Realized PnL from this trade event in USD.
event_type
string
"fulfill_taker" if the account was the taker; "fulfill_maker" if the maker.
side
string
One of "open_long", "open_short", "close_long", "close_short".
created_at
integer
Timestamp (ms) of the trade event.
cause
string
"normal", "market_liquidation", "backstop_liquidation", or "settlement".
next_cursor
string
Cursor for the next page.
has_more
boolean
true when additional pages exist.

GET /api/v1/funding/history — Get Funding History

Returns paginated funding payment history for an account. Request
account
string
required
User’s wallet address.
limit
integer
Maximum records to return. Defaults to the system-defined limit.
cursor
string
Pagination cursor.
curl "https://api.pacifica.fi/api/v1/funding/history?account=42trU9A5...&limit=20"
Response
{
  "success": true,
  "data": [
    {
      "history_id": 2287920,
      "symbol": "PUMP",
      "side": "ask",
      "amount": "39033804",
      "payout": "2.617479",
      "rate": "0.0000125",
      "created_at": 1759222804122
    }
  ],
  "next_cursor": "11114Lz77",
  "has_more": true
}
history_id
integer
Unique ID for this funding event.
symbol
string
Trading pair symbol.
side
string
Whether the position was long ("bid") or short ("ask").
amount
decimal string
Position size (in token denomination) at time of funding.
payout
decimal string
Funding paid in USD. Positive means received; negative means paid.
rate
decimal string
Funding rate used to calculate the payout.
created_at
integer
Timestamp (ms) of the funding payment.
next_cursor
string
Cursor for the next page.
has_more
boolean
true when additional pages exist.

GET /api/v1/portfolio — Get Account Equity History

Returns time-series account equity and PnL snapshots for charting or analytics. Request
account
string
required
User’s wallet address.
time_range
string
required
Pre-defined time window: 1d, 7d, 14d, 30d, or all.
start_time
integer
Start time in milliseconds (overrides time_range lower bound).
end_time
integer
End time in milliseconds.
limit
integer
Maximum records to return. Defaults to 100.
curl "https://api.pacifica.fi/api/v1/portfolio?account=42trU9A5...&time_range=7d"
Response
{
  "success": true,
  "data": [
    {
      "account_equity": "61046.308885",
      "pnl": "9297.553505",
      "timestamp": 1761177600000
    }
  ],
  "error": null,
  "code": null
}
account_equity
decimal string
Account equity (balance + unrealized PnL) at the snapshot time.
pnl
decimal string
Cumulative PnL of the account since creation.
timestamp
integer
Timestamp (ms) of the snapshot.

GET /api/v1/account/balance/history — Get Account Balance History

Returns all balance-affecting events for an account (deposits, withdrawals, fees, funding, etc.). Request
account
string
required
User’s wallet address.
limit
integer
Maximum records to return. Defaults to the system-defined limit.
cursor
string
Pagination cursor.
curl "https://api.pacifica.fi/api/v1/account/balance/history?account=42trU9A5..."
Response
{
  "success": true,
  "data": [
    {
      "amount": "100.000000",
      "balance": "1200.000000",
      "pending_balance": "0.000000",
      "event_type": "deposit",
      "created_at": 1716200000000
    }
  ],
  "next_cursor": "11114Lz77",
  "has_more": true
}
amount
decimal string
Change in balance from this event.
balance
decimal string
Account balance after the event.
pending_balance
decimal string
Pending balance after the event.
event_type
string
Type of balance event. Possible values:
ValueDescription
depositDeposit funds to account
deposit_releaseRelease of a previously pending deposit
withdrawWithdrawal from account
tradeTrading activity (fees, realized PnL)
market_liquidationLiquidation by market orders
backstop_liquidationLiquidation by backstop mechanism
adl_liquidationLiquidation by auto-deleveraging
subaccount_transferTransfer between subaccounts
fundingFunding payment
payoutPayout event (e.g. affiliate program)
created_at
integer
Timestamp (ms) of the balance event.
next_cursor
string
Cursor for the next page.
has_more
boolean
true when additional pages exist.

POST /api/v1/account/withdraw — Request Withdrawal

Initiates a USDC withdrawal from the account to the connected wallet.
This endpoint requires a signed request. Set the type header field to "withdraw". See Authentication.
Request
account
string
required
User’s wallet address.
signature
string
required
Cryptographic signature.
timestamp
integer
required
Current timestamp in milliseconds.
amount
string
required
Amount to withdraw in USDC, e.g. "100.50".
agent_wallet
string
Agent wallet address.
expiry_window
integer
Signature expiry in milliseconds.
{
  "account": "42trU9A5...",
  "signature": "5j1Vy9Uq...",
  "timestamp": 1716200000000,
  "amount": "100.50",
  "expiry_window": 30000
}
Response
{
  "success": true
}

GET /api/v1/account/loan — Get Account Loan Info

Returns loan and collateral information for an account under unified margin, including borrowed amounts, accrued interest, and per-asset collateral values. Request
account
string
required
Account wallet address.
curl "https://api.pacifica.fi/api/v1/account/loan?account=42trU9A5..."
Response
{
  "success": true,
  "data": {
    "borrowed": "1250.500000",
    "pending_interest": "3.250000",
    "collateral_utilization": "0.45",
    "total_interest_earned": "120.750000",
    "total_interest_paid": "85.300000",
    "spot_balances": [
      {
        "symbol": "SOL",
        "amount": "10.00000000",
        "ltv_ratio": "0.90",
        "market_value": "1500.000000",
        "collateral_value": "1350.000000"
      }
    ],
    "updated_at": 1716200000000
  },
  "error": null,
  "code": null
}
borrowed
decimal string
Current borrowed amount in USD.
pending_interest
decimal string
Accrued interest not yet repaid.
collateral_utilization
decimal string
Ratio of borrowed amount to total spot collateral capacity.
total_interest_earned
decimal string
Cumulative interest earned as a lender.
total_interest_paid
decimal string
Cumulative interest paid as a borrower (returned as a positive number).
spot_balances
array
Spot balances with collateral contribution details.
updated_at
integer
Timestamp (ms) of the last data update.

POST /api/v1/positions/add_isolated_margin — Add Isolated Margin

Transfers USDC from the free balance into the isolated margin pool of a specific position.
This endpoint requires a signed request. Set the type header field to "add_isolated_margin". See Authentication.
Request
account
string
required
User’s wallet address.
signature
string
required
Cryptographic signature.
timestamp
integer
required
Current timestamp in milliseconds.
symbol
string
required
Trading pair symbol.
amount
string
required
Amount of USDC to add as isolated margin.
agent_wallet
string
Agent wallet address.
expiry_window
integer
Signature expiry in milliseconds.
{
  "account": "42trU9A5...",
  "signature": "5J3mBbAH...",
  "timestamp": 1716200000000,
  "symbol": "BTC-PERP",
  "amount": "100.000000"
}
Response
{
  "success": true
}

POST /api/v1/account/settings/spot — Update Spot Settings

Updates per-asset spot settings, such as excluding a spot asset from unified margin collateral calculations.
This endpoint requires a signed request. Set the type header field to "update_account_spot_settings". See Authentication.
Request
account
string
required
User’s wallet address.
signature
string
required
Cryptographic signature.
timestamp
integer
required
Current timestamp in milliseconds.
symbol
string
required
Spot asset symbol, e.g. SOL.
unified_margin_excluded
boolean
required
true to exclude this asset from unified margin collateral; false to include it.
agent_wallet
string
Agent wallet address.
expiry_window
integer
Signature expiry in milliseconds.
{
  "account": "42trU9A5...",
  "signature": "5J3mBbAH...",
  "timestamp": 1716200000000,
  "symbol": "SOL",
  "unified_margin_excluded": true
}
Response
{
  "success": true
}

POST /api/v1/account/settings/auto_lend_disabled — Toggle Auto-Lending

Enables or disables automatic lending of idle USDC balances to the loan pool.
This endpoint requires a signed request. Set the type header field to "set_auto_lend_disabled". See Authentication.
Request
account
string
required
User’s wallet address.
signature
string
required
Cryptographic signature.
timestamp
integer
required
Current timestamp in milliseconds.
disabled
boolean or null
true to disable auto-lending, false to enable, or null to restore the default (enabled).
agent_wallet
string
Agent wallet address.
expiry_window
integer
Signature expiry in milliseconds.
{
  "account": "42trU9A5...",
  "signature": "5J3mBbAH...",
  "timestamp": 1716200000000,
  "disabled": true
}
Response
{
  "success": true
}

GET /api/v1/account/spot_balance/history — Get Spot Balance History

Returns paginated balance event history for spot assets held on the account. Request
account
string
required
User’s wallet address.
symbol
string
Filter by spot asset symbol, e.g. SOL.
limit
integer
Maximum records to return. Defaults to the system-defined limit.
cursor
string
Pagination cursor.
curl "https://api.pacifica.fi/api/v1/account/spot_balance/history?account=42trU9A5..."
Response
{
  "success": true,
  "data": [
    {
      "amount": "1.00000000",
      "balance": "5.50000000",
      "symbol": "SOL",
      "event_type": "deposit",
      "created_at": 1716200000000
    }
  ],
  "next_cursor": "11114Lz77",
  "has_more": true
}
amount
decimal string
Change in balance from this event.
balance
decimal string
Spot asset balance after the event.
symbol
string
Spot asset symbol.
event_type
string
Type of balance event (e.g. "deposit", "withdrawal").
created_at
integer
Timestamp (ms) of the event.
next_cursor
string
Cursor for the next page.
has_more
boolean
true when additional pages exist.

POST /api/v1/account/spot_asset/withdraw — Withdraw Spot Asset

Submits a withdrawal request for a spot asset.
This endpoint requires a signed request. Set the type header field to "withdraw_spot_asset". See Authentication.
Request
account
string
required
User’s wallet address.
signature
string
required
Cryptographic signature.
timestamp
integer
required
Current timestamp in milliseconds.
symbol
string
required
Spot asset symbol, e.g. SOL.
amount
string
required
Amount to withdraw.
idempotency_key
string
Full UUID to prevent duplicate withdrawals.
agent_wallet
string
Agent wallet address.
expiry_window
integer
Signature expiry in milliseconds.
{
  "account": "42trU9A5...",
  "signature": "5J3mBbAH...",
  "timestamp": 1716200000000,
  "symbol": "SOL",
  "amount": "1.00000000"
}
Response
{
  "success": true,
  "data": {
    "symbol": "SOL",
    "batch_nonce": 42,
    "requested_amount": "1.00000000",
    "fee_amount": "0.00100000"
  }
}
symbol
string
Spot asset symbol.
batch_nonce
integer
Nonce of the withdrawal batch.
requested_amount
decimal string
Amount requested for withdrawal.
fee_amount
decimal string
Fee deducted from the withdrawal.

GET /api/v1/account/spot_asset/withdraw/pending — Get Pending Spot Withdrawals

Returns all pending spot asset withdrawals for an account awaiting on-chain settlement. Request
account
string
required
User’s wallet address.
curl "https://api.pacifica.fi/api/v1/account/spot_asset/withdraw/pending?account=42trU9A5..."
Response
{
  "success": true,
  "data": [
    {
      "symbol": "SOL",
      "amount": "1.00000000",
      "amount_requested": "1.00100000",
      "fee_amount": "0.00100000",
      "batch_nonce": 42,
      "created_at": 1716200000000
    }
  ]
}
symbol
string
Spot asset symbol.
amount
decimal string
Net amount to be received after fees.
amount_requested
decimal string
Original requested withdrawal amount.
fee_amount
decimal string
Fee deducted.
batch_nonce
integer
Nonce of the withdrawal batch.
created_at
integer
Timestamp (ms) when the withdrawal was requested.

GET /api/v1/account/spot_asset/deposit/history — Get Spot Deposit History

Returns paginated spot asset deposit history for an account. Request
account
string
required
User’s wallet address.
limit
integer
Maximum records to return. Defaults to the system-defined limit.
cursor
string
Pagination cursor.
curl "https://api.pacifica.fi/api/v1/account/spot_asset/deposit/history?account=42trU9A5..."
Response
{
  "success": true,
  "data": [
    {
      "symbol": "SOL",
      "amount": "1.50000000",
      "transaction_id": "5xGk...",
      "created_at": 1716200000000
    }
  ],
  "next_cursor": "11114Lz77",
  "has_more": true
}
symbol
string
Spot asset symbol.
amount
decimal string
Amount deposited.
transaction_id
string
On-chain transaction identifier.
created_at
integer
Timestamp (ms) of the deposit.
next_cursor
string
Cursor for the next page.
has_more
boolean
true when additional pages exist.

GET /api/v1/account/spot_asset/withdraw/history — Get Spot Withdrawal History

Returns paginated spot asset withdrawal history for an account. Request
account
string
required
User’s wallet address.
limit
integer
Maximum records to return. Defaults to the system-defined limit.
cursor
string
Pagination cursor.
curl "https://api.pacifica.fi/api/v1/account/spot_asset/withdraw/history?account=42trU9A5..."
Response
{
  "success": true,
  "data": [
    {
      "symbol": "SOL",
      "amount": "1.00000000",
      "batch_nonce": 42,
      "transaction_id": "5xGk...",
      "created_at": 1716200000000
    }
  ],
  "next_cursor": "11114Lz77",
  "has_more": true
}
symbol
string
Spot asset symbol.
amount
decimal string
Amount withdrawn.
batch_nonce
integer
Nonce of the withdrawal batch.
transaction_id
string
On-chain transaction identifier.
created_at
integer
Timestamp (ms) of the withdrawal.
next_cursor
string
Cursor for the next page.
has_more
boolean
true when additional pages exist.

Build docs developers (and LLMs) love