License: Creative Commons Attribution 4.0 International license (CC BY 4.0)
When quoting this document, please refer to the following
DOI: 10.4230/OASIcs.FMBC.2021.1
URN: urn:nbn:de:0030-drops-154254
URL: http://dagstuhl.sunsite.rwth-aachen.de/volltexte/2021/15425/
Dave, Kinnari ;
Sjöberg, Vilhelm ;
Sun, Xinyuan
Towards Verified Price Oracles for Decentralized Exchange Protocols
Abstract
Various smart contracts have been designed and deployed on blockchain platforms to enable cryptocurrency trading, leading to an ever expanding user base of decentralized exchange platforms (DEXs). Automated Market Maker contracts enable token exchange without the need of third party book-keeping. These contracts also serve as price oracles for other contracts, by using a mathematical formula to calculate token exchange rates based on token reserves. However, the price oracle mechanism is vulnerable to attacks both from programming errors and from mistakes in the financial model, and so far their complexity makes it difficult to formally verify them. We present a verified AMM contract and validate its financial model by proving a theorem about a lower bound on the cost of manipulation of the token prices to the attacker. The contract is implemented using the DeepSEA system, which ensures that the theorem applies to the actual EVM bytecode of the contract. This theorem could be used as proof of correctness for other contracts using the AMM, so this is a step towards a verified DeFi landscape.
BibTeX - Entry
@InProceedings{dave_et_al:OASIcs.FMBC.2021.1,
author = {Dave, Kinnari and Sj\"{o}berg, Vilhelm and Sun, Xinyuan},
title = {{Towards Verified Price Oracles for Decentralized Exchange Protocols}},
booktitle = {3rd International Workshop on Formal Methods for Blockchains (FMBC 2021)},
pages = {1:1--1:14},
series = {Open Access Series in Informatics (OASIcs)},
ISBN = {978-3-95977-209-9},
ISSN = {2190-6807},
year = {2021},
volume = {95},
editor = {Bernardo, Bruno and Marmsoler, Diego},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/opus/volltexte/2021/15425},
URN = {urn:nbn:de:0030-drops-154254},
doi = {10.4230/OASIcs.FMBC.2021.1},
annote = {Keywords: Smart Contract Verification, Interactive Theorem Proving, Blockchain, Decentralized Finance}
}
Keywords: |
|
Smart Contract Verification, Interactive Theorem Proving, Blockchain, Decentralized Finance |
Collection: |
|
3rd International Workshop on Formal Methods for Blockchains (FMBC 2021) |
Issue Date: |
|
2021 |
Date of publication: |
|
30.11.2021 |
Supplementary Material: |
|
Software (Source Code): https://github.com/certikfoundation/deepsea |