Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.superbots.finance/llms.txt

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

Every vault accepts deposits and withdrawals through a pair of REST endpoints backed by on-chain events. When you deposit, the backend records the transaction and tracks your position. When you withdraw, it records the outflow and adjusts your reported balance. The backend also listens for on-chain Transfer events and automatically reconciles any transactions it might have missed, applying deposit and withdrawal fees from the vault entity.
Fees are applied at the smart contract level and are non-refundable. Always check the vault’s depositFee and withdrawalFee fields before transacting.

Depositing

1

Connect your wallet

Open the vault detail page and connect your Web3 wallet. The UI initialises a Web3Modal session and reads your on-chain balance for the vault’s currency1 token.
2

Approve the token

Before the first deposit into any vault, you must approve the vault’s contractAddress to spend your tokens. This is a standard ERC-20 approve transaction and requires a gas fee.
3

Enter an amount and deposit

Enter the amount of currency1 you want to deposit. Confirm the transaction in your wallet. Once the transaction is confirmed on-chain, call the deposit recording endpoint below.
4

Record the deposit

POST the transaction details to the API so your position is tracked off-chain:
POST /vaults/deposit
Request body:
tx
string
required
The on-chain transaction hash of the deposit.
vaultId
string
required
The ID of the vault you deposited into.
account
string
required
Your wallet address.
amount
number
required
The amount deposited, in currency1 units.
The platform automatically reconciles on-chain events periodically. If you skip the POST call, your deposit will still be detected — but there may be a short delay before your balance is reflected.

Withdrawing

1

Check for an unstake requirement

Some vaults require a signed unstake request before a withdrawal can be processed. Check whether you have a pending request:
GET /vaults/unstake-requests/all/{account}
If the vault requires unstaking and you have no active request, submit one before proceeding.
2

Submit an unstake request (if required)

POST /vaults/unstake-requests/add
account
string
required
Your wallet address.
amount
string
required
The amount to unstake.
nonce
number
required
A unique nonce for the request, used in signature verification.
contractAddress
string
required
The vault’s contract address.
signature
string
required
An EIP-191 signature of the Solidity-encoded hash of (account, amount, nonce, contractAddress), signed by your wallet private key. The server verifies this before creating the request.
The server recovers the signer from the signature and rejects the request if the recovered address does not match account.
3

Execute the withdrawal on-chain

Call the vault contract’s withdrawal function from your wallet. Confirm the transaction and copy the transaction hash.
4

Record the withdrawal

POST /vaults/withdraw
The request body is identical to POST /vaults/deposit: provide tx, vaultId, account, and amount.

Querying your deposit history

Your net deposit for a single vault

GET /vaults/initial-deposit/{vaultId}/{account}
Returns { amount } — the sum of all deposits minus the sum of all withdrawals for your account in the specified vault. Account matching is case-insensitive.

Your net deposit across all vaults

GET /vaults/initial-deposit-all/{account}
Returns { amount } — your net position across every vault.

Per-vault breakdown

GET /vaults/initial-deposit-all-details/{account}
Returns an object keyed by vaultId, with each value being the net deposit amount for that vault.

Fee behaviour

Fees are deducted automatically from your deposit or withdrawal amount by the vault’s smart contract:
  • Deposit fee — deducted when you deposit; your recorded position reflects the amount after the fee.
  • Withdrawal fee — deducted when you withdraw; the amount you receive is reduced by the fee percentage.
Check the vault’s depositFee and withdrawalFee fields on the vault detail page before transacting.
You can check a vault’s fee structure before depositing by inspecting the depositFee and withdrawalFee fields returned by GET /vaults/all or GET /vaults/perp-vaults.