Skip to content

Withdraw from Filecoin Pay

As clients store data with you, payments accrue in Filecoin Pay. This guide shows how to withdraw your available USDFC balance to your wallet and swap it to FIL.

Two tools can do this. filpay-cli is recommended: it is built on the Synapse SDK and handles pending nonces correctly even while your PDP nodes are actively sending transactions. Foundry (cast) works for reference, but has a known nonce bug on Filecoin that causes frequent failures on busy nodes.

This guide covers Mainnet withdrawals. The addresses below, the default rpc.ankr.com/filecoin endpoint, and the SushiSwap swap all target Mainnet. The same commands work on Calibration with the Calibration contract addresses and an RPC such as https://api.calibration.node.glif.io/rpc/v1.

ContractAddress
Payments0x23b1e018F08BB982348b15a86ee926eEBf7F4DAa
USDFC Token0x80B98d3aa09ffff255c3ba4A241111Ff1262F045
  • Node.js 18+

  • Your wallet private key

  • Some FIL for gas

  • filpay-cli installed:

    Terminal window
    npm install -g filpay-cli
  1. Check your available balance. Replace <YOUR_WALLET_ADDRESS> with your address:

    Terminal window
    filpay balance --account <YOUR_WALLET_ADDRESS>

    For wallet balance and more detail, add --detailed:

    Terminal window
    filpay balance --account <YOUR_WALLET_ADDRESS> --detailed

    The command returns four values:

    FieldDescription
    Current FundsTotal funds in your Filecoin Pay account
    AvailableWithdrawable amount, what you can take out now
    Lockup RateAmount locked in active payment rails
    Wallet BalanceUSDFC in your wallet (shown with --detailed)
  2. Withdraw funds to your wallet:

    Terminal window
    filpay withdraw <AMOUNT> --key <YOUR_PRIVATE_KEY>

    Examples:

    Terminal window
    filpay withdraw 10 --key $PRIVATE_KEY # withdraw 10 USDFC
    filpay withdraw 0.5 --key $PRIVATE_KEY # withdraw 0.5 USDFC
    filpay withdraw 10 --to 0xRecipientAddress --key $PRIVATE_KEY # to another address

    The default RPC is https://rpc.ankr.com/filecoin. Use a different endpoint with --rpc:

    Terminal window
    filpay withdraw 10 --key $PRIVATE_KEY --rpc https://api.node.glif.io/rpc/v1

filpay-cli also covers wallet and rail operations:

Terminal window
filpay wallet-balance --account <YOUR_WALLET_ADDRESS> # wallet USDFC balance
filpay wallet-balance --key $PRIVATE_KEY # include contract balance
filpay rails list --key $PRIVATE_KEY # list your payment rails
filpay rails info <RAIL_ID> --key $PRIVATE_KEY # detail for one rail
filpay settle 0xPayerAddress --key $PRIVATE_KEY # settle a specific payer
filpay rails settle-all --key $PRIVATE_KEY --yes # settle all rails
filpay settlement-preview 0xPayerAddress --key $PRIVATE_KEY # preview before settling
filpay deposit 100 --key $PRIVATE_KEY # deposit USDFC into Filecoin Pay
filpay balance --account <YOUR_ADDRESS> --json # JSON output for scripting
  • “Insufficient funds”. You are withdrawing more than your available balance. Re-check it with filpay balance.
  • “Nonce too low”. Unlike cast, filpay-cli handles nonces correctly even with active PDP nodes. Wait a moment and retry.
  • Transaction reverts. Ensure your wallet has enough FIL for gas.
  • Balance shows 0. Funds may still be locked in active payment rails. If this looks wrong, contact the FOC team.
  • “filpay: not found”. Install it globally with npm install -g filpay-cli, or run it with npx filpay-cli balance --account <YOUR_ADDRESS>.

After withdrawing, the USDFC is in your wallet. To swap it to FIL, open SushiSwap, connect your wallet, enter the amount of USDFC to swap, then review and confirm the transaction.