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, withdrawals and transfers through Lean cover Polymarket and Hyperliquid only. Fund your
Kalshi and Polymarket US accounts on those venues directly.
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:
Supported assets include USDC, USDT, ETH and DAI on Polygon, Base, Arbitrum, Optimism, Ethereum,
BSC and Solana. 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.
- 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. - Only one Hyperliquid withdrawal runs at a time for an account. Another one started before it
settles 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.- 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.
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 today.
Shares can’t move between venues. A sell is placed on the venues that hold the shares.