Skip to content

Commit

Permalink
routeToRatio endpoint + CLI refactor (Uniswap#4)
Browse files Browse the repository at this point in the history
* restructure CLI for multi-command

* routeToRatio

* new entrypoint: quote-to-ratio
  • Loading branch information
ewilz authored Sep 17, 2021
1 parent a433d3e commit 1bc5a60
Show file tree
Hide file tree
Showing 14 changed files with 901 additions and 172 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ JSON_RPC_PROVIDER = '<JSON_RPC_PROVIDER>'
Then from the root directory you can execute the CLI.

```
./bin/cli --tokenIn 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 --tokenOut 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984 --amount 1000 --exactIn --recipient 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B
./bin/cli quote --tokenIn 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 --tokenOut 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984 --amount 1000 --exactIn --recipient 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B
Best Route:
100.00% = USDC -- 0.3% --> UNI
Expand All @@ -41,4 +41,23 @@ Value: 0x00
blockNumber: "13088815"
estimatedGasUsed: "113000"
gasPriceWei: "130000000000"
./bin/cli quote-to-ratio --token0 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 --token1 0xdac17f958d2ee523a2206206994597c13d831ec7 --feeAmount 3000 --recipient 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B --token0Balance 1000 --token1Balance 2000 --tickLower -120 --tickUpper 120
Best Route:
100.00% = USDT -- 0.05% --> USDC
Raw Quote Exact In:
392.68
Gas Adjusted Quote In}:
346.13
Gas Used Quote Token: 46.550010
Gas Used USD: 46.342899
Calldata: 0x414bf389000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000176a736c000000000000000000000000000000000000000000000000000000001764f8650000000000000000000000000000000000000000000000000000000000000000
Value: 0x00
blockNumber: "13239188"
estimatedGasUsed: "113000"
gasPriceWei: "116690684398"
```
5 changes: 2 additions & 3 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ if (dev) {
});
}

require(`../scripts/cli`)
.UniswapSORCLI.run()
.catch(require("@oclif/errors/handle"));
require('@oclif/command').run()
.catch(require('@oclif/errors/handle'))
Loading

0 comments on commit 1bc5a60

Please sign in to comment.