| 1234567891011121314151617181920 |
- import { ethers } from 'ethers';
- export interface UniswapV3Options {
- provider: ethers.JsonRpcProvider;
- }
- export class UniswapV3Source {
- private provider: ethers.JsonRpcProvider;
- constructor(options: UniswapV3Options) {
- this.provider = options.provider;
- }
- // 从池读取 sqrtPriceX96 并换算(占位)
- async getPrice(poolAddress: string, inverted: boolean = false): Promise<{ price: number; timestamp: number } | null> {
- if (!poolAddress || poolAddress === '0x0000000000000000000000000000000000000000') return null;
- // TODO: 读取 slot0.sqrtPriceX96 并转换为价格
- return null;
- }
- }
|