@@ -9,18 +9,18 @@ The unofficial Python client for the [Uniswap](https://uniswap.io/).
99_ I am in no way affiliated with or funded by Uniswap, uniswap.io, or any subsidiaries or affiliates of any of the previously mentioned entities._
1010
1111## Functionality
12- * A simple to use Python wrapper for all available contract functions and variables
13- * Simple parsing of data returned from the Uniswap contract
12+ * A simple to use Python wrapper for all available contract functions and variables
13+ * Simple parsing of data returned from the Uniswap contract
1414
1515## Under Development
16- * Run tests on a private chain rather than Rinkeby
17- * Better error handling
16+ * Run tests on a private chain rather than Rinkeby
17+ * Better error handling
1818
1919## Getting Started
2020This README is documentation on the syntax of the python client presented in this repository. See function docstrings for full syntax details.
2121This API attempts to present a clean interface to Uniswap, but in order to use it to its full potential, you must familiarize yourself with the official Uniswap documentation.
2222
23- * https://docs.uniswap.io/
23+ * https://docs.uniswap.io/
2424
2525You may manually install the project or use pip:
2626
@@ -51,88 +51,88 @@ dai = "0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359"
5151```
5252
5353#### Market Methods
54- * [ get_fee_maker] ( https://docs.uniswap.io/ )
54+ * [ get_fee_maker] ( https://docs.uniswap.io/ )
5555``` python
5656uniswap_wrapper.get_fee_maker()
5757```
5858
59- * [ get_fee_taker] ( https://docs.uniswap.io/ )
59+ * [ get_fee_taker] ( https://docs.uniswap.io/ )
6060``` python
6161uniswap_wrapper.get_fee_taker()
6262```
6363
64- * [ get_eth_token_input_price] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L416 )
64+ * [ get_eth_token_input_price] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L416 )
6565``` python
6666# Get the public price for ETH to Token trades with an exact input.
6767uniswap_wrapper.get_eth_token_input_price(bat, 1 * 10 ** 18 )
6868uniswap_wrapper.get_eth_token_input_price(dai, 5 * 10 ** 18 )
6969```
7070
71- * [ get_token_eth_input_price] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L437 )
71+ * [ get_token_eth_input_price] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L437 )
7272``` python
7373# Get the public price for token to ETH trades with an exact input.
7474uniswap_wrapper.get_token_eth_input_price(bat, 1 * 10 ** 18 )
7575uniswap_wrapper.get_token_eth_input_price(dai, 5 * 10 ** 18 )
7676```
7777
78- * [ get_eth_token_output_price] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L426 )
78+ * [ get_eth_token_output_price] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L426 )
7979``` python
8080# Get the public price for ETH to Token trades with an exact output
8181uniswap_wrapper.get_eth_token_output_price(bat, 1 * 10 ** 18 )
8282uniswap_wrapper.get_eth_token_output_price(dai, 5 * 10 ** 18 )
8383```
8484
85- * [ get_token_eth_output_price] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L448 )
85+ * [ get_token_eth_output_price] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L448 )
8686``` python
8787# Get the public price for token to ETH trades with an exact output.
8888uniswap_wrapper.get_token_eth_output_price(bat, 1 * 10 ** 18 )
8989uniswap_wrapper.get_token_eth_output_price(dai, 5 * 10 ** 18 )
9090```
9191
9292#### ERC20 Pool Methods
93- * [ get_eth_balance] ( https://docs.uniswap.io/smart-contract-integration/vyper )
93+ * [ get_eth_balance] ( https://docs.uniswap.io/smart-contract-integration/vyper )
9494``` python
9595# Get the balance of ETH in an exchange contract.
9696uniswap_wrapper.get_eth_balance(bat)
9797```
9898
99- * [ get_token_balance] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L469 )
99+ * [ get_token_balance] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L469 )
100100``` python
101101# Get the balance of a token in an exchange contract.
102102uniswap_wrapper.get_token_balance(bat)
103103```
104104
105- * [ get_exchange_rate] ( https://github.com/Uniswap/uniswap-frontend/blob/master/src/pages/Pool/AddLiquidity.js#L351 )
105+ * [ get_exchange_rate] ( https://github.com/Uniswap/uniswap-frontend/blob/master/src/pages/Pool/AddLiquidity.js#L351 )
106106``` python
107107# Get the balance of a token in an exchange contract.
108108uniswap_wrapper.get_exchange_rate(bat)
109109```
110110
111111#### Liquidity Methods
112112
113- * [ add_liquidity] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L48 )
113+ * [ add_liquidity] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L48 )
114114``` python
115115# Add liquidity to the pool.
116116uniswap_wrapper.add_liquidity(bat, 1 * 10 ** 18 )
117117```
118118
119- * [ remove_liquidity] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L83 )
119+ * [ remove_liquidity] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L83 )
120120``` python
121121# Remove liquidity from the pool.
122122uniswap_wrapper.removeliquidity(bat, 1 * 10 ** 18 )
123123```
124124
125125#### Trading
126- * make_trade
127- * eth_to_token_input
128- * [ ethToTokenSwapInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L127 )
129- * [ ethToTokenTransferInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L162 )
130- * token_to_eth_input
131- * [ tokenToEthSwapInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L202 )
132- * [ tokenToEthTransferInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L232 )
133- * token_to_token_input
134- * [ tokenToTokenSwapInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L271 )
135- * [ tokenToTokenTransferInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L307 )
126+ * make_trade
127+ * eth_to_token_input
128+ * [ ethToTokenSwapInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L127 )
129+ * [ ethToTokenTransferInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L162 )
130+ * token_to_eth_input
131+ * [ tokenToEthSwapInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L202 )
132+ * [ tokenToEthTransferInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L232 )
133+ * token_to_token_input
134+ * [ tokenToTokenSwapInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L271 )
135+ * [ tokenToTokenTransferInput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L307 )
136136``` python
137137# Make a trade based on the input parameters
138138uniswap_wrapper.make_trade(eth, bat, 1 * 10 ** 18 ) # calls _eth_to_token_input
@@ -141,16 +141,16 @@ uniswap_wrapper.make_trade(bat, dai, 1*10**18) # calls _token_to_token_input
141141uniswap_wrapper.make_trade(eth, bat, 1 * 10 ** 18 , " 0x123..." ) # calls _eth_to_token_input
142142```
143143
144- * make_trade_output
145- * eth_to_token_swap_output
146- * [ ethToTokenSwapOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L167 )
147- * [ ethToTokenTransferOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L197 )
148- * token_to_eth_swap_output
149- * [ tokenToEthSwapOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L237 )
150- * [ tokenToEthTransferOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L266 )
151- * token_to_token_swap_output
152- * [ tokenTotokenSwapOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L312 )
153- * [ tokenTotokenTransferOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L349 ) )
144+ * make_trade_output
145+ * eth_to_token_swap_output
146+ * [ ethToTokenSwapOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L167 )
147+ * [ ethToTokenTransferOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L197 )
148+ * token_to_eth_swap_output
149+ * [ tokenToEthSwapOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L237 )
150+ * [ tokenToEthTransferOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L266 )
151+ * token_to_token_swap_output
152+ * [ tokenTotokenSwapOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L312 )
153+ * [ tokenTotokenTransferOutput] ( https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy#L349 ) )
154154``` python
155155# Make a trade where the output qty is known based on the input parameters
156156uniswap_wrapper.make_trade_output(eth, bat, 1 * 10 ** 18 ) # calls _eth_to_token_swap_output
@@ -170,32 +170,32 @@ python -m pytest -W ignore::DeprecationWarning
170170```
171171
172172## Ownership Disclosure
173- * I own some BAT and DAI tokens that are seen in the examples above. These tokens are used only for example purposes and are not meant to be an endorsement. I am not affiliated with BAT, Brave, Basic Attention Token, Brave Browser, DAI, Maker, MakerDAO, or any subsidiaries.
173+ * I own some BAT and DAI tokens that are seen in the examples above. These tokens are used only for example purposes and are not meant to be an endorsement. I am not affiliated with BAT, Brave, Basic Attention Token, Brave Browser, DAI, Maker, MakerDAO, or any subsidiaries.
174174
175175## Changelog
176176_ 0.3.3_
177- * Provide token inputs as addresses instead of names
177+ * Provide token inputs as addresses instead of names
178178
179179_ 0.3.2_
180- * Add ability to transfer tokens after a trade
181- * Add tests for this new functionality
180+ * Add ability to transfer tokens after a trade
181+ * Add tests for this new functionality
182182
183183_ 0.3.1_
184- * Add tests for all types of trades
184+ * Add tests for all types of trades
185185
186186_ 0.3.0_
187- * Add ability to make all types of trades
188- * Add example to README
187+ * Add ability to make all types of trades
188+ * Add example to README
189189
190190_ 0.2.1_
191- * Add liquidity tests
191+ * Add liquidity tests
192192
193193_ 0.2.0_
194- * Add liquidity and ERC20 pool methods
194+ * Add liquidity and ERC20 pool methods
195195
196196_ 0.1.1_
197- * Major README update
197+ * Major README update
198198
199199_ 0.1.0_
200- * Add market endpoints
201- * Add tests for market endpoints
200+ * Add market endpoints
201+ * Add tests for market endpoints
0 commit comments