题目
题目

46912 Quiz 2 Automatic Market Maker Examples

单项选择题

Suppose we have a smart contract that is able to exchange CT tokens for TT tokens and TT tokens for CT tokens. It is based on a constant product formula. The number of CT tokens times the number of TT tokens is always equal to 200. The current market price of a CT token is 5 ETH and the current market price of a TT token is 10 ETH.  To allow swaps, the contract is initially provide with 20 CT tokens and 10 TT tokens.  Note: This is a constant product AMM. If a trader sends 5 CT tokens to the contract, how many TT tokens should she expect in exchange? (We are not concerned with fees.)

选项
A.1
B.4
C.2
D.3
E.5
查看解析

查看解析

标准答案
Please login to view
思路分析
Start by identifying the constant product invariant: CT_tokens_in_pool × TT_tokens_in_pool = 200, which is the k value. Initially, the pool has 20 CT and 10 TT, and 20 × 10 = 200, so the invariant holds. Now a trader sends 5 CT tokens to the contract. The CT side of the pool increases to 20 +......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!