Deposit and Withdraw Funds
After adding contracts, you need to ensure your subscription has sufficient funds to pay for callback gas fees. You can deposit funds through the web interface or using on-chain functions.
Understanding Your Grant
Remember, you have a grant from Supra that's used before your deposited funds: This is displayed in UI.
How Grants Work:
Callback fees are deducted from your grant first
Once grant is exhausted, fees come from your deposited funds
Grants cannot be withdrawn - they're only for callback fees
Your deposited funds remain untouched until grant is fully used
Deposit Funds
Navigate to Subscription Management
Go to supra.com/data/dvrf
Connect your wallet (subscription owner)
Click on "My Subscription"
Add Funds
Click "Deposit Funds" from the menu
Enter the amount to deposit
Review current balance and minimum balance requirement.
Confirm the transaction in your wallet
Verify Deposit
Check updated balance in the interface
Ensure balance is above minimum threshold
Monitor deposit balance alerts.
Managing Grants
// Check remaining grant
let remaining_grant = deposit::get_client_remaining_grant(client_address);
// Check total grant received
let total_grant = deposit::get_client_total_grant(client_address);
Deposit funds
movedeposit::deposit_fund_v2(
sender: &signer,
client_address: address,
deposit_amount: u64
)Parameters:
sender- The signer depositing the funds (can be any address)client_address- The whitelisted wallet address receiving the depositdeposit_amount- Amount to deposit (in the smallest unit of the native token)
Key Features:
✅ Anyone can deposit on behalf of a client
✅ Useful for team members or automated top-up services.
Checking Your Balance
Before depositing, check your current balance and minimum balance requirements:
// Check total deposited funds
let total_balance = deposit::check_client_fund(client_address);
// Check minimum balance requirement
let min_balance = deposit::check_min_balance_client_v2(client_address);000000000000000000Best Practices
Deposit Strategy
Maintain Buffer: Keep 3-5x your minimum balance for uninterrupted service.
5x minimum = Comfortable buffer for high-volume applications
3x minimum = Acceptable for moderate usage
Below 2x minimum = Risky, may block requests soon
Regular Monitoring: Check your balance periodically, especially during high-usage periods
Automated Top-ups: Consider implementing an automated deposit script that monitors your balance
Multiple Depositors: Designate team members or services that can deposit on your behalf for redundancy
Withdraw Funds
You can withdraw excess funds from your subscription when needed via UI or via onchain functions.
Navigate to "My Subscription".
Click "Withdraw Funds" from the Menu.
Enter withdrawal amount.
Confirm transaction in your wallet.
deposit::withdraw_fund(
sender: &signer,
withdraw_amount: u64
)Parameters:
sender- Your signer (must be the whitelisted wallet owner)withdraw_amount- Amount to withdraw (in smallest unit)
Important Restrictions:
❌ Only the whitelisted wallet owner can withdraw their own funds.
❌ Grants cannot be withdrawn - only deposited funds.
Last updated
