Skip to main content
POST
/
deposit
curl -X POST "https://api.strike.markets/deposit" \
  -H "Content-Type: application/json" \
  -d '{
    "walletAddress": "0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46",
    "amount": "500.0",
    "txHash": "0x1234567890abcdef1234567890abcdef12345678901234567890abcdef123456",
    "timestamp": "2024-01-15T14:30:00Z"
  }'
{
  "success": true,
  "message": "Deposit verified and recorded successfully",
  "amount": "500.0",
  "txHash": "0x1234567890abcdef1234567890abcdef12345678901234567890abcdef123456",
  "verified": true,
  "block_number": 18945123
}
curl -X POST "https://api.strike.markets/deposit" \
  -H "Content-Type: application/json" \
  -d '{
    "walletAddress": "0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46",
    "amount": "500.0",
    "txHash": "0x1234567890abcdef1234567890abcdef12345678901234567890abcdef123456",
    "timestamp": "2024-01-15T14:30:00Z"
  }'
{
  "success": true,
  "message": "Deposit verified and recorded successfully",
  "amount": "500.0",
  "txHash": "0x1234567890abcdef1234567890abcdef12345678901234567890abcdef123456",
  "verified": true,
  "block_number": 18945123
}

Overview

Record and verify a user deposit to the Strike Protocol. This endpoint validates on-chain transactions and updates your account balance accordingly.
This endpoint does NOT require authentication as it verifies transactions on-chain. The transaction itself provides proof of ownership and authenticity.

How Deposits Work

Process Flow

  1. On-chain Transaction: You send USDC to Strike Protocol smart contract
  2. Record Deposit: Call this endpoint with transaction details
  3. Verification: API verifies the transaction on-chain
  4. Balance Update: Your Strike Protocol balance is credited

Supported Assets

  • USDC: Primary trading asset on Strike Protocol
  • Other stablecoins: May be supported in the future

Request Body

walletAddress
string
required
Ethereum wallet address that made the deposit.Format: 42-character hex string starting with “0x”
Example: “0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46”
amount
string
required
Deposit amount in USD.Format: Decimal string
Example: “500.0”
txHash
string
required
Ethereum transaction hash for the deposit.Format: 66-character hex string starting with “0x”
Example: “0x1234567890abcdef1234567890abcdef12345678901234567890abcdef123456”
timestamp
string
required
ISO timestamp when the transaction was submitted.Format: ISO 8601 with UTC timezone
Example: “2024-01-15T14:30:00Z”

Response Fields

success
boolean
Indicates if the deposit was verified and recorded successfully
message
string
Descriptive message about the operation result
amount
string
Confirmed deposit amount that was verified on-chain
txHash
string
Transaction hash that was successfully verified
verified
boolean
Confirmation that on-chain verification succeeded
block_number
integer
Block number in which the transaction was included

Verification Process

On-Chain Validation

The API performs comprehensive verification:
  1. Transaction Existence: Confirms transaction exists on-chain
  2. Contract Interaction: Verifies transaction interacted with Strike Protocol contract
  3. Amount Matching: Confirms deposited amount matches request
  4. Wallet Verification: Ensures transaction originated from specified wallet
  5. Duplicate Prevention: Prevents double-counting of the same transaction

Verification Criteria

  • Block Confirmations: Minimum confirmations required for security
  • Contract Address: Must interact with official Strike Protocol contract
  • Asset Type: Must be supported asset (USDC)
  • Gas Payment: Transaction must have succeeded (not reverted)

Deposit Mechanics

Balance Updates

After successful verification:
  • Account Balance: Increased by deposit amount
  • Withdrawable Balance: Immediately available for withdrawal
  • Trading Balance: Available for opening positions

Transaction Fees

  • Network fees: Standard Ethereum gas fees (paid by user)
  • Protocol fees: No fees charged for deposits
  • Processing fees: No additional fees

Processing Time

  • Verification: Usually instant if transaction is confirmed
  • Balance Update: Immediate after verification
  • Trading Availability: Funds available for trading immediately

Error Responses

400 Bad Request
object
Invalid request parameters or transaction verification failed
{
  "error": 400,
  "message": "Transaction verification failed: amount mismatch"
}
Common causes:
  • Invalid wallet address format
  • Transaction hash not found
  • Amount doesn’t match on-chain transaction
  • Transaction failed or was reverted
409 Conflict
object
Transaction already recorded (duplicate submission)
{
  "error": 409,
  "message": "Transaction already recorded"
}
503 Service Unavailable
object
Blockchain RPC issues or temporary verification problems
{
  "error": 503,
  "message": "Unable to verify transaction on-chain, please try again"
}

Usage Examples

Standard USDC Deposit

{
  "walletAddress": "0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46",
  "amount": "1000.0",
  "txHash": "0x...",
  "timestamp": "2024-01-15T14:30:00Z"
}

Small Deposit

{
  "walletAddress": "0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46",
  "amount": "50.0",
  "txHash": "0x...",
  "timestamp": "2024-01-15T14:30:00Z"
}

Large Deposit

{
  "walletAddress": "0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46",
  "amount": "10000.0",
  "txHash": "0x...",
  "timestamp": "2024-01-15T14:30:00Z"
}

Making a Deposit

Step 1: Send On-Chain Transaction

// Example interaction with Strike Protocol contract
USDC.transfer(strikeProtocolContract, amount);

Step 2: Get Transaction Hash

After sending the transaction, get the transaction hash from your wallet or block explorer.

Step 3: Record Deposit

Call this endpoint with the transaction details to update your Strike Protocol balance.

Step 4: Verify Balance

Use Account Info to confirm your balance was updated.

Integration Examples

Web3.js Integration

// Send on-chain deposit
const tx = await usdcContract.transfer(strikeContract, amount);
await tx.wait(); // Wait for confirmation

// Record deposit with Strike API
const response = await fetch('https://api.strike.markets/deposit', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    walletAddress: userAddress,
    amount: amount.toString(),
    txHash: tx.hash,
    timestamp: new Date().toISOString()
  })
});

Ethers.js Integration

// Send deposit transaction
const tx = await signer.sendTransaction({
  to: strikeProtocolContract,
  data: depositCalldata,
  value: 0
});

const receipt = await tx.wait();

// Record with API
await recordDeposit({
  walletAddress: await signer.getAddress(),
  amount: depositAmount,
  txHash: receipt.transactionHash,
  timestamp: new Date().toISOString()
});

Best Practices

Transaction Handling

  • Wait for confirmations: Ensure transaction has sufficient confirmations
  • Check transaction status: Verify transaction succeeded before recording
  • Handle reorgs: Be prepared for blockchain reorganizations
  • Gas estimation: Use proper gas limits to avoid failed transactions

Error Handling

  • Retry logic: Implement retries for temporary verification failures
  • Duplicate detection: Handle cases where deposit was already recorded
  • User feedback: Provide clear error messages to users
  • Monitoring: Track failed deposits for manual review

Security Considerations

  • Amount validation: Double-check amounts match transaction
  • Contract verification: Ensure interaction with correct contract
  • Wallet ownership: Verify user owns the depositing wallet
  • Replay protection: Prevent duplicate transaction submissions

Troubleshooting

Common Issues

  1. “Transaction verification failed”
    • Check if transaction hash is correct
    • Ensure transaction succeeded on-chain
    • Verify amount matches transaction value
  2. “Transaction already recorded”
    • Deposit was already processed
    • Check account balance for credit
    • Don’t resubmit the same transaction
  3. “Unable to verify transaction on-chain”
    • Blockchain RPC may be experiencing issues
    • Wait a few minutes and retry
    • Check if transaction has sufficient confirmations

Verification Steps

  1. Check Transaction: View transaction on block explorer
  2. Confirm Success: Ensure transaction status is “Success”
  3. Verify Contract: Confirm interaction with Strike Protocol contract
  4. Match Amount: Ensure deposit amount matches transaction value

Next Steps

After recording a deposit:
  1. Verify Balance - Check Account Info for updated balance
  2. Start Trading - Use funds for Long or Short positions
  3. Monitor Account - Track activity in Dashboard
Always verify your deposit was successful by checking your account balance after recording the transaction.
Only submit each transaction hash once. Duplicate submissions will be rejected to prevent double-counting.

Body

application/json
walletAddress
string
required

User's Ethereum wallet address

amount
string
required

Deposit amount in USD

txHash
string
required

Transaction hash for verification

timestamp
string<date-time>
required

ISO timestamp

Response

Deposit recorded and verified successfully

success
boolean
message
string