Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhnguyennguyen authored Oct 23, 2020
1 parent 02aaa7e commit 0db1393
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Note: WETH address is `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2`
- getExecutionPrice: return the exact price for the trade with your specified amount
- getMidPriceViaETH: return the reference price using route via ETH
- getExecutionPriceViaETH: return the exact price for the trade with your specified amount using route via ETH
- getMidPriceViaExactToken: return the reference price using route via ExactToken
- getExecutionPriceViaExactToken: return the exact price for the trade with your specified amount using route via ExactToken

### Arguments
- sourceToken: address of source token
Expand All @@ -39,6 +41,13 @@ data = await uniswapPrice.getMidPriceViaETH("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3
data = await uniswapPrice.getExecutionPriceViaETH("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", 6, "0x6B175474E89094C44Da98b954EedeAC495271d0F", 18, "1000000000")
console.log(data)
let USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
USDCDecimal = 6
// getMidPrice via USDC Token
// route: 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 -> USDC -> 0x6B175474E89094C44Da98b954EedeAC495271d0F
data = await uniswapPrice.getMidPriceViaExactToken("0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", 6, "0x6B175474E89094C44Da98b954EedeAC495271d0F", 18, USDC, USDCDecimal)
console.log(data)
}
```

0 comments on commit 0db1393

Please sign in to comment.