Best way to calculate price?
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 28/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- python
- 领域
- api, fintech-quant
调研方向
Read the issue’s example using uniswap_wrapper.get_price_input and the discussion in its four comments to understand the unanswered question about token decimals. Check the library’s price calculation entry points and related tests, if present, to establish how input and output amounts are represented. Done means documenting a correct way to calculate a price for one input unit and whether output token decimals are needed.
由索引模型根据 Issue 内容生成。
描述
Hi
I am currently rewriting an application using the latest versoin of the library and I always had some issues in the past with checking the prices, due to the decimals of the tokens. So I want to know if there's a better approach to this one that I have in mind, or if I am just overcomplicating things. But I assume that if you want to get the price (not just the output amount of tokens you would get), you need the decimals
I always use the input price method, so I would go like this for only one input unit
price = 1 / (uniswap_wrapper.get_price_input(eth, token, 1 * 10 ** "input token decimals") / (1 * 10 ** "Output token decimals"))
Example (assuming the token I want to get the price from has 9 decimals:
price = 1 / (uniswap_wrapper.get_price_input(eth, token, 1 * 10 ** 18) / (1 * 10 ** 9))
Is this correct? Or is there a better way to do this without getting the decimals of the token you want to get?
Thanks
- 主要语言
- Python
- 星标
- 1k
- 派生
- 373
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 6
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
uniswap-python/uniswap-python 的其他 Issue
-
Broken links in the docs可能已有人在做 @ankush-dev-eng 于 3 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 78/100
uniswap-python/uniswap-python#487 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 10/100
uniswap-python/uniswap-python#492 · 2 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 35/100
uniswap-python/uniswap-python#415 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 20/100
uniswap-python/uniswap-python#405 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
uniswap-python/uniswap-python#404 · 1 个 reaction ·
维护者通常 1 天内回复
查看 uniswap-python/uniswap-python 的全部 Issue
相似的 Issue
-
area: tools documentation good first issue ready for a contributor
难度 2/5 1-3 小时 新手友好度 82/100
eyalgolan/statecraft-israel#873 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 5 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复