WAproxy Value-Based Send Example (USDT→BTC) + Protocol Fee + Network Margin
VERSION:
V1
DESCRIPTION:
This document provides a concrete, numeric example of how WAproxy send execution
behaves when a user targets a real-world value (e.g., 10 USDT) and sends BTC.
It demonstrates:
- converting market value to amount_sat
- applying protocol fee (3%)
- reserving network safety margin
- understanding receiver net amount
------------------------------------------------------------
KEY PARAMETERS
------------------------------------------------------------
FEE_BPS:
300 (3%)
safety_margin:
Extra funds reserved to absorb dynamic network fees.
Safety margin is not a fixed network fee.
network_fee:
Dynamic and external. Deducted from wallet balance.
------------------------------------------------------------
MARKET REFERENCE (EXAMPLE INPUT)
------------------------------------------------------------
Example market reference:
10 USDT ≈ 0.00015 BTC
Note:
Market prices are variable.
This example demonstrates the execution math, not price discovery.
------------------------------------------------------------
CONVERT BTC TO SAT (BITCOIN ATOMIC UNIT)
------------------------------------------------------------
Bitcoin conversion:
1 BTC = 100,000,000 sat
Therefore:
0.00015 BTC × 100,000,000 = 15,000 sat
Set:
amount_sat = 15,000
------------------------------------------------------------
PROTOCOL FEE (3%)
------------------------------------------------------------
protocol_fee = amount_sat × (FEE_BPS / 10,000)
protocol_fee = 15,000 × (300 / 10,000)
protocol_fee = 15,000 × 0.03
protocol_fee = 450 sat
------------------------------------------------------------
RECEIVER NET AMOUNT
------------------------------------------------------------
receiver_gets = amount_sat - protocol_fee
receiver_gets = 15,000 - 450
receiver_gets = 14,550 sat
Interpretation:
The recipient receives the net amount after protocol fee deduction.
The protocol fee does not block execution.
------------------------------------------------------------
BALANCE REQUIREMENT (NETWORK SAFETY MARGIN)
------------------------------------------------------------
WAproxy execution requires:
wallet_balance >= amount_sat + safety_margin
Example safety margin:
safety_margin = 500 sat
Then:
min_required_balance = 15,000 + 500
min_required_balance = 15,500 sat
Notes:
- network_fee is deducted from wallet balance, not from amount_sat.
- safety_margin exists to prevent fee-related failures.
- actual network_fee may be lower or higher than 500 sat depending on conditions.
------------------------------------------------------------
SUMMARY (EXAMPLE OUTPUT)
------------------------------------------------------------
Market target:
10 USDT ≈ 0.00015 BTC ≈ 15,000 sat
Execution:
amount_sat = 15,000 sat
protocol_fee (3%) = 450 sat
receiver_gets = 14,550 sat
safety_margin = 500 sat (example)
min_balance = 15,500 sat
------------------------------------------------------------
OPTIONAL NOTE: EXACT NET TARGET
------------------------------------------------------------
If an application wants the receiver to get an exact net value,
it must reverse-calculate amount_sat:
amount_sat = desired_net / (1 - 0.03)
Example:
desired_net = 15,000 sat
amount_sat ≈ 15,000 / 0.97 ≈ 15,463 sat (rounded)
This reverse calculation is an application-layer choice.
------------------------------------------------------------
END OF DOCUMENT
------------------------------------------------------------