[simplex, sdk]: add Uniswap V4 and Aerodrome funding venues#731
Conversation
43b0b5d to
17bca16
Compare
|
@royvardhan Let's update the docs in this PR |
Done ser. |
seunlanlege
left a comment
There was a problem hiding this comment.
Observation: Overshoot buffer doesn't fully cover slippage tolerance (Uniswap V4)
In UniswapV4FundingPlanner.ts, the withdrawal adds a 0.05% (5 bps) overshoot buffer to the target amount:
const bufferedRemaining = remaining + (remaining * 5n) / 10_000nBut the slippage tolerance is set to 0.10% (10 bps):
const SLIPPAGE_TOLERANCE = new Percent(10, 10_000) // 0.10%This means in the worst case:
- Need 100 tokens
- Withdraw 100.05 (buffered)
- Slippage hits the full 0.10% → receive ~99.95
- Transaction succeeds but you're 0.05 short of what's actually needed
The buffer doesn't fully cover the slippage tolerance. If slippage exceeds 0.05%, the withdrawal succeeds but the subsequent fill could fail due to insufficient funds.
Consider either increasing the buffer to match or exceed the slippage tolerance, or reducing the slippage tolerance to match the buffer.
Thanks for this. |
65086f7 to
95c635d
Compare
…rify startup validation requirements for bid/ask curves and introduce optional spread configuration. Update pricing logic to prioritize Uniswap V4 rates exclusively when configured, and improve error handling for pricing sources.
…ing, approvals - Increase slippage tolerance from 0.10% to 0.50% in both Aerodrome and V4 - Buffer withdrawal targets by slippage so credited tokens cover the fill - Replace 6s price polling with on-demand async getExoticTokenPrice - Store venue prices per-chain to fix multi-token mispricing - Add consume() tracking to prevent double-booking liquidity across concurrent plans - Batch LP approvals via ERC-7821 in Aerodrome initialise - Use order.deadline (blocks → timestamp via viem blockTime) for tx deadlines - Deduplicate tick decode helpers (import from ABI module) - Aerodrome getExoticTokenPrice returns null instead of throwing - Downgrade hot-path logs from info to debug - Remove ASCII chart banner from CLI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the pre-fetched price map with a single getVenuePrice() helper that queries on-demand. Prices are fetched once per chain per order evaluation, not stored as class state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rify startup validation requirements for bid/ask curves and introduce optional spread configuration. Update pricing logic to prioritize Uniswap V4 rates exclusively when configured, and improve error handling for pricing sources.
…ing, approvals - Increase slippage tolerance from 0.10% to 0.50% in both Aerodrome and V4 - Buffer withdrawal targets by slippage so credited tokens cover the fill - Replace 6s price polling with on-demand async getExoticTokenPrice - Store venue prices per-chain to fix multi-token mispricing - Add consume() tracking to prevent double-booking liquidity across concurrent plans - Batch LP approvals via ERC-7821 in Aerodrome initialise - Use order.deadline (blocks → timestamp via viem blockTime) for tx deadlines - Deduplicate tick decode helpers (import from ABI module) - Aerodrome getExoticTokenPrice returns null instead of throwing - Downgrade hot-path logs from info to debug - Remove ASCII chart banner from CLI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the pre-fetched price map with a single getVenuePrice() helper that queries on-demand. Prices are fetched once per chain per order evaluation, not stored as class state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mprove transaction handling - Re-enable the test for USDC to cNGN LP NFT minting with V4 funding. - Integrate DelegationService for delegation setup and ensure successful delegation. - Add waitForTxPoolDrained function to manage transaction pool state and prevent in-flight transaction issues. - Enhance event log decoding for ERC-721 Transfer events to ensure proper mint receipt validation.
- Re-enable the test for placing USDC to cNGN orders on Base mainnet. - Introduce the use of CurrencyAmount for token amounts. - Add detailed logging for pool parameters and order placement. - Ensure the test correctly handles expected outcomes and transaction flow.
…ridge into roy/defi-strategies
Closes #700