Mathematical Models and Loops Used by GliderGPT AI Agents
Liquidity Pool Price Impact (Constant Product AMM):
Plain text:
P_new = P_old * (1 - Q_trade / Q_pool)
Explanation:
Q_trade
: Trade quantityQ_pool
: Total liquidity in the pool
Slippage Calculation:
Plain text:
S = ÎP / P_original
Explanation:
ÎP
: Change in priceP_original
: Initial price before the trade
Transaction Fee Estimation:
Plain text:
F = V * r
Explanation:
V
: Trade volumer
: Fee rate (e.g., 0.3% for most DEXs)
Net Proceeds from Liquidation:
Plain text:
N = P_sell * Q_sell - F - G
Explanation:
P_sell
: Selling priceQ_sell
: Quantity soldF
: FeesG
: Gas costs
Loops for Computation
Optimization Loop for Best DEX:
Trade Size Adjustment to Minimize Slippage:
Dynamic ROI Calculations:
Last updated
Was this helpful?