GET /v1/balances shows them all. Lean routes an order to the venues that can
pay for it, so fund the venues you want orders to reach.
Deposits and withdrawals through Lean cover Polymarket and Hyperliquid only. Live
transfers move cash between Polymarket, Hyperliquid and Lighter. Fund your Kalshi
and Polymarket US accounts on those venues directly.
GET /v1/balances and GET /v1/positions cover Kalshi, Polymarket, Polymarket US and
Hyperliquid. Cash moved to Lighter and Lighter positions don’t appear there; check them in the
Lean app.
A test key needs no funding. It trades against simulated balances. See
Test mode and live mode.
Deposit through Lean’s addresses only
Send funds only to the deposit addresses Lean gives the trading account. Each address bridges into the right balance for you:
The accepted tokens differ by chain and venue.
List deposit assets returns every chain and token
each venue accepts right now, with the minimum for each. The Polymarket bridge sets a minimum
deposit per asset, and a deposit below it may not be credited. Relay publishes no fixed minimum for Hyperliquid deposits, and neither does a pUSD
transfer straight to the Polymarket wallet.
Network fees
A deposit is an ordinary token transfer: the sender pays that network’s usual fee. After that, you need no gas. Hyperliquid orders are signed actions with no gas, and Polymarket actions are paid for by Polymarket’s relayer.Deposits through the API
- List deposit assets shows the chains and tokens
each venue accepts.
min_deposit_usdis the route’s minimum, ornullwhen the route publishes none. - Get deposit addresses returns your addresses, and Create deposit addresses creates any that are missing. Creating is idempotent.
- List deposits shows the latest deposits to your
addresses on a venue, newest first, with each one’s
status:detectedonce the funds reach the address,processingwhile they move, thencompletedwhen the venue is credited,failed, orrefundedto the sender. It lists deposits that go through Relay or the Polymarket bridge. pUSD sent straight to your Polymarket wallet is credited at once and is not listed. A test key reads an empty list. - Get balances shows funds once they arrive.
Withdrawals through the API
A key can withdraw only when it was created for it. Create the key in the Lean app under Settings, API keys, or with Create an API key, and send:scopeswithwithdraw. A key without it is refused with403 FORBIDDEN. Thewithdrawscope is separate fromtrade, so a key that trades cannot withdraw unless you add it.maxWithdrawalMicros, the largest single withdrawal, anddailyWithdrawalLimitMicros, the total the key may withdraw in any rolling 24 hours. Both are optional and in millionths of a dollar. Leave one out for no limit of that kind. When you set both, the daily limit must be at least the single one.
sourceis the venue and the asset held there.destinationis the chain, the asset and the address paid.amountis how much of the source asset leaves the venue.
destination.chain is one of polygon, arbitrum, base, optimism, ethereum, bsc or
solana. The address must suit the chain: a 0x address for every chain except solana, which
takes a Solana address. Any other pair, or an address the chain cannot take, is refused with
400 VALIDATION_ERROR, and the message says what is supported.
A live withdrawal sends real funds:
- The venue’s fee comes out of the amount. The response gives
feeandnet_amount, the amount the destination is quoted to receive. Both come from the venue’s quote when the withdrawal is made, so the amount that arrives can differ slightly. - The account must have trading enabled. Creating a live key that can trade or withdraw in the
Lean app enables it for the whole account, so there is nothing else to switch on. If it isn’t
enabled, the withdrawal is refused with
403 FORBIDDENanddetails.reasonACCOUNT_NOT_DELEGATED. - Pausing trading for the key or its account also pauses its withdrawals. A paused key’s withdrawal
is refused with
503 FEATURE_DISABLEDanddetails.reasonTRADING_PAUSED. - Each withdrawal is submitted to the venue once. It starts
pendingand becomescompletedonce the venue pays it, orfailedwhen the venue refuses it. A failed withdrawal pays nothing, even though it still shows the quotedfeeandnet_amount, andfailure_reasonsays why. Read it back with Get a withdrawal to follow it. - A Polymarket withdrawal is
completedonce the pUSD has left the account for Polymarket’s bridge. The bridge then pays the USDC on the chain you named, usually within a few minutes, so check the destination before relying on the funds. A Hyperliquid withdrawal iscompletedonce the USDC has arrived on the chain you named. - A Hyperliquid withdrawal waits for any other transfer on the account to finish. That includes
another withdrawal, a live transfer and a transfer started in the Lean app. While one is in
progress, a new withdrawal is refused with
409 CONFLICTanddetails.reasonWITHDRAWAL_IN_PROGRESS.
completed at once.
source, destination and amount, and adds fee, net_amount, status
and failure_reason. Get a withdrawal and
List withdrawals return the same fields.
client_withdrawal_idmakes the call safe to repeat. Sending the same request again returns the first withdrawal and takes nothing more. Reusing the ID with a different venue, amount or destination is refused with409 CONFLICT, anddetails.withdrawal_idnames the first one. While trading is paused, a repeat is refused with503 FEATURE_DISABLEDlike a new withdrawal. Read the first one with Get a withdrawal or List withdrawals instead.- A withdrawal over the key’s single limit, over its daily limit or over the venue’s available cash
is refused with
422 VALIDATION_ERROR. See Errors. - List withdrawals shows the account’s withdrawals
in the key’s mode, newest first, with
next_cursorfor the next page and an optionalvenuefilter. Get a withdrawal reads one byid. - Reset test mode deletes the test withdrawals and gives their cash back.
Convert USDC to pUSD
Polymarket trades only with pUSD. USDC or USDC.e sent straight to the account’s Polymarket wallet, instead of through a deposit address, sits there without counting as cash until it is converted.- Get convertible balances shows the
usdcandusdc_ewaiting in the wallet. - Convert to pUSD converts the whole balance of one
source_asset,usdcorusdc_e, into the same amount of pUSD. It needs the trade scope.
venue, source_asset, amount_usd, status, transaction_id,
failure_reason and livemode.
- USDC.e converts in one transaction:
settledonce it confirms,submittedwhile it is on its way. USDC goes through Polymarket’s bridge, so it is alwayssubmittedand its pUSD shows in Get balances a few minutes later. failedconverted nothing, andfailure_reasonsays why.- The bridge has a minimum for USDC. A smaller balance is refused with
422 VALIDATION_ERRORanddetails.reasonBELOW_MINIMUM, and the message names the minimum. - An empty balance is refused with
422 VALIDATION_ERRORanddetails.reasonNOTHING_TO_CONVERT. One conversion runs at a time per account; another sent while one is settling is refused with409 CONFLICTanddetails.reasonCONVERSION_IN_PROGRESS. - A live conversion needs trading enabled for the account in the Lean app, and is refused with
403 FORBIDDENanddetails.reasonACCOUNT_NOT_DELEGATEDotherwise. It follows the trading pause and the key’s allowed venues. - When Lean cannot reach Polymarket’s relayer, a conversion is refused with
503 FEATURE_DISABLEDand nodetails.reason, and nothing is submitted. Try again later. - A test key’s cash is always pUSD, so it reads zero for both and a conversion is refused with
NOTHING_TO_CONVERT.
Using funds on either venue
You don’t need to move funds between venues. Lean routes each order to the best venue, and when the cash is on the other venue,POST /v1/orders moves it and buys in the same call. See
Paying from the other venue. To sign that payment yourself,
see Advanced: self-signed routed orders.
To move cash between your own venues without an order, use Transfers. They work with
test keys and live keys.
Shares can’t move between venues. A sell is placed on the venues that hold the shares.