A direct transfer is a transaction your wallet sends, paying the gas: a deposit to the escrow, a GMX withdrawal to GMX’s MultichainTransferRouter. No quote, no maker. Tokens: deployment values.
  • Offer a new one only where GET /v1/venues shows chain.direct_deposit (or chain.direct_withdrawal) true; native USDC on Polygon also needs chain.wallet_funding.conversion.
  • owner, the payer, is the master or the account linked on venue. A deposit’s recipient is an account linked on venue, its receiving setup done: the venue’s owner address, never a deposit address or a Polymarket wallet. A withdrawal’s recipient is owner.
  • min_out equals amount, except for native USDC on Polygon: at least 0.01 USDC in, and min_out, the least pUSD deposited, at least ceil(amount × 9,995 / 10,000). A deposit’s min_out reaches the venue’s release_minimum.
  • Hyperliquid and Polymarket withdrawals and sends use margin transfers; cross-venue transfers use takes, with wallet funding and wallet delivery when needed.

With the SDK

  • Persist client_operation_id first. Resume with the same request and store: directTransfer reconciles a pending operation and never sends again after an unknown prompt or a lost answer.
  • It checks the operation against the request and the pinned deployment, reads the funds, approves exactly amount only when the allowance is short, then sends the transaction. beforeSigning runs before each prompt (step approve, deposit or withdrawal); one that throws sends nothing.
  • signer.sendTransaction calls its hash callback once broadcast and resolves once mined.
  • inspectDirectTransaction(transaction, owner, now?, recipient?) checks, in an isolated signer, that a transaction is a direct call from owner, a deposit crediting recipient (owner by default), and returns its terms. It reads the chain, contract and calldata only: refuse a transaction with a non-zero native value yourself.
  • The Rust SDK runs the same steps: session.direct_transfer(&DirectRequest::deposit(..)?, &sender), its transactions sent through your TransactionSender (Rust SDK).

Over HTTP

  1. POST /v1/direct with the request: it returns the operation, prepared, with its escrow, nonce and deadline (30 minutes ahead). The same client_operation_id and terms return the same operation.
  2. GET /v1/direct/{id}/funding reads balance and allowance now. For a deposit, approve amount of token to the escrow when the allowance is short.
  3. Before the wallet prompt, post an empty body: it moves prepared to pending once, across tabs and devices. After a lost answer, never prompt again.
  4. Send the transaction from owner: a deposit is directDeposit(recipient, token, amount, min_out, nonce, deadline) on the escrow; a GMX withdrawal is transferOut on GMX’s MultichainTransferRouter (margin transfers).
  5. Report each broadcast tx_hash, replacements included, to the same route, at most eight distinct hashes.
  6. GET /v1/direct/{id} until confirmed, failed or expired.

Outcomes

  • confirmed: final on chain, received the amount moved. Hyperliquid credits HyperCore afterwards: read the venue before spending it.
  • expired: a deposit not executed by its deadline, or a withdrawal never sent, once the chain is read past it.
  • failed: the reported withdrawal reverted.
  • A deposit is found by its nonce, reported or not.
  • A GMX withdrawal has no nonce: once pending, it stays so until its hash is reported and found final. Never send another one because it is slow.