After building a marketplace around a utility , we quickly encountered a (predictable) problem: Who owns our ? We rapidly found that the circulation created by our was smaller than the base of consumers we wanted to reach. Exchanges are confusing. The whole model is new. The of acquiring blocked their use.
Clearly, we needed a unicorn.
Enter : “A protocol for automated exchange on .” Uniswap provides liquidity pooling for ERC-20 , abiding by the in determining exchange amounts.
What does the Constant Product Market Maker Model look like?
x × y = k
All this asserts is that the product of two variables, x and y, remains constant, k.
In a Uniswap pool, x measures the quantity of pooled ether and y measures the quantity of pooled ERC-20 . A smart contract holds the ether and , and permits swaps which maintain the constant relationship of their product. (To encourage the pooling of liquidity, stakers are allocated a 0.3% fee per swap.)
(x + 𝚫x) × (y + 𝚫y) = k
Consequently, Uniswap provides heterogeneous liquidity at self-adjusting exchange rates.
The guests we’re trying to reach aren’t interested in swapping , though; they want to book travel! Sending off to an exchange (Uniswap or otherwise) is just not viable.
And so we introduced . The goal of Unipay is simple: Allow buyers and sellers to transact transparently in their preferred .
This is not such a new idea; credit cards and other payment processors already handle currency conversion as a matter of course. Unipay introduces this capability to the ERC-20 ecosystem, and it does so in a trustless, auditable way, end-to-end.
Payments with ERC-20 most often take the form of an approve call: A holder grants permission to an address (usually a contract) to withdraw some amount of , and then the payment system uses that approval to handle the rest.
The technical realization of transparent conversion should, then, adhere to the same pattern: The purchaser makes an approve call, and the payment handler sees an approve call. However, this approval needs to occur on two different .
Unipay bridges this gap. Specifically, Unipay is a smart contract which withdraws an approved amount of from a purchaser, uses Uniswap to exchange those for our preferred , and then approves the withdrawal of those by our contract. Payment via ether is handled similarly, for the most part. There is no equivalent to an approve call with ether, so instead funds are directly transferred by the purchaser and then converted to for withdrawal.
Published at Mon, 25 Feb 2019 18:12:59 +0000