问题标签 [uniswap]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
blockchain - 如何计算 - 最低收款、价格影响和流动性提供者费用?
我找到了一个公式,但我不知道如何计算AmountInWithFee 这里是计算价格的公式,但我在数学上失败了。
我正在研究 polyon 网络测试网 如何计算amountInWithFee?
onstant_product = reserve_a_initial * reserve_b_initial;
Reserve_b_after_execution = constant_product / (reserve_a_initial + amountInWithFee);
amountOut = reserve_b_initial - reserve_b_after_execution;
market_price = amountInWithFee / amountOut;
mid_price = reserve_a_initial / reserve_b_initial;
price_impact = 1 - (mid_price / market_price)
blockchain - 通过 ethers 监听 uniswap 事件
我有一个简单的代码,旨在监听 Uniswap Router V3 协议事件
我没有收到任何事件。如果我将地址更改为例如 Metamask 路由器或 DAI 合约,我会收到相应的事件。
我确定 Uniswap Router 版本 3 的合约地址是正确的。合约地址如下链接: https ://docs.uniswap.org/protocol/reference/deployments
而且当我检查 etherscan 时,它有很多事务和事件。 https://etherscan.io/address/0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45
智能合约在监听事件上有什么区别?!
为什么我只接收 Uniswap V3 路由器的事件?