Overview
Record and verify a user withdrawal from Strike Protocol. This endpoint validates on-chain withdrawal transactions and updates your account balance accordingly.This endpoint does NOT require authentication as it verifies transactions on-chain. The transaction hash provides proof of the withdrawal operation.
How Withdrawals Work
Process Flow
- Withdrawal Request: Initiated through Strike Protocol frontend or smart contract
- On-chain Execution: Withdrawal transaction executed on blockchain
- Record Withdrawal: Call this endpoint with transaction details
- Verification: API verifies the transaction on-chain
- Balance Update: Your Strike Protocol balance is debited
Withdrawal Types
- Standard Withdrawal: Normal withdrawal of available balance
- Emergency Withdrawal: Withdrawal of all funds during emergencies
- Partial Withdrawal: Withdrawal of portion of available balance
Request Body
Ethereum wallet address that initiated the withdrawal.Format: 42-character hex string starting with “0x”
Example: “0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46”
Example: “0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46”
Withdrawal amount in USD.Format: Decimal string
Example: “250.0”
Example: “250.0”
Ethereum transaction hash for the withdrawal.Format: 66-character hex string starting with “0x”
Example: “0x1234567890abcdef1234567890abcdef12345678901234567890abcdef123457”
Example: “0x1234567890abcdef1234567890abcdef12345678901234567890abcdef123457”
ISO timestamp when the withdrawal transaction was submitted.Format: ISO 8601 with UTC timezone
Example: “2024-01-15T15:45:00Z”
Example: “2024-01-15T15:45:00Z”
Response Fields
Indicates if the withdrawal was verified and recorded successfully
Descriptive message about the operation result
Verification Process
On-Chain Validation
The API performs comprehensive verification:- Transaction Existence: Confirms withdrawal transaction exists on-chain
- Contract Interaction: Verifies transaction interacted with Strike Protocol contract
- Amount Matching: Confirms withdrawn amount matches request
- Wallet Verification: Ensures withdrawal was sent to specified wallet
- Duplicate Prevention: Prevents double-counting of the same withdrawal
- Balance Validation: Ensures sufficient balance existed before withdrawal
Verification Criteria
- Block Confirmations: Minimum confirmations required for security
- Contract Address: Must originate from official Strike Protocol contract
- Asset Type: Must be supported asset (USDC)
- Transaction Success: Withdrawal must have completed successfully
Withdrawal Mechanics
Balance Updates
After successful verification:- Account Balance: Decreased by withdrawal amount
- Withdrawable Balance: Reduced accordingly
- Reserved Balance: Remains unchanged (margin for open positions)
Withdrawal Limits
- Available Balance: Can only withdraw non-reserved funds
- Open Positions: Must maintain sufficient margin for positions
- Minimum Balance: May have minimum balance requirements
Processing Time
- Verification: Usually instant if transaction is confirmed
- Balance Update: Immediate after verification
- Blockchain Settlement: Funds available in wallet immediately
Error Responses
Invalid request parameters or transaction verification failedCommon causes:
- Invalid wallet address format
- Transaction hash not found
- Amount doesn’t match on-chain transaction
- Withdrawal not from Strike Protocol contract
- Transaction failed or was reverted
Transaction already recorded (duplicate submission)
Blockchain RPC issues or temporary verification problems
Usage Examples
Standard Withdrawal
Partial Withdrawal
Large Withdrawal
Making a Withdrawal
Step 1: Check Available Balance
Use Account Info to verify your withdrawable balance.Step 2: Initiate Withdrawal
Call the withdrawal function on Strike Protocol smart contract or use the frontend interface.Step 3: Get Transaction Hash
After the withdrawal transaction is confirmed, get the transaction hash from your wallet or block explorer.Step 4: Record Withdrawal
Call this endpoint with the transaction details to update your Strike Protocol balance.Step 5: Verify Balance
Confirm your balance was updated correctly using Account Info.Integration Examples
Web3.js Integration
Frontend Integration
Balance Management
Available vs Reserved
- Available Balance: Funds available for withdrawal
- Reserved Balance: Margin locked in open positions
- Total Balance: Available + Reserved
Withdrawal Constraints
You can only withdraw funds that are:- Not reserved as margin for open positions
- Not pending in other operations
- Above any minimum balance requirements
Position Impact
Withdrawals do not affect:- Open position margins
- Position sizes or leverage
- Liquidation prices
- Unrealized PnL
Best Practices
Transaction Handling
- Confirm Success: Ensure withdrawal transaction succeeded before recording
- Wait for Confirmations: Allow sufficient block confirmations
- Gas Management: Use appropriate gas limits for withdrawal transactions
- Error Handling: Implement proper error handling for failed withdrawals
Balance Management
- Check Availability: Always verify available balance before withdrawal
- Reserve Calculation: Account for margin requirements in open positions
- Timing: Consider market conditions and position status
Security Considerations
- Amount Verification: Double-check withdrawal amounts
- Contract Verification: Ensure interaction with correct contract
- Wallet Security: Verify withdrawal destination wallet
- Transaction Monitoring: Monitor withdrawal transactions for completion
Troubleshooting
Common Issues
-
“Insufficient withdrawable balance”
- Check available balance vs. reserved margin
- Close positions to free up margin
- Verify account balance is sufficient
-
“Transaction verification failed”
- Ensure transaction hash is correct
- Verify transaction succeeded on-chain
- Check if withdrawal came from Strike Protocol contract
-
“Withdrawal transaction already recorded”
- Withdrawal was already processed
- Check account balance for debit
- Don’t resubmit the same transaction
-
“Unable to verify withdrawal transaction”
- Blockchain RPC may be experiencing issues
- Wait for more confirmations
- Retry after a few minutes
Verification Steps
- Check Transaction: View transaction on block explorer
- Confirm Source: Ensure withdrawal came from Strike Protocol contract
- Verify Amount: Confirm withdrawal amount matches request
- Check Status: Ensure transaction completed successfully
Next Steps
After recording a withdrawal:- Verify Balance - Check Account Info for updated balance
- Monitor Wallet - Confirm funds arrived in your wallet
- Review Activity - Track transaction in Dashboard
- Plan Trading - Consider impact on available trading balance
Only withdraw funds that are not reserved as margin for open positions. Ensure you maintain sufficient balance for your trading activities.
Always verify your withdrawal was successful by checking both your Strike Protocol balance and your wallet balance after recording the transaction.
Body
application/json