1.0.7 • Published 12 months ago
@steerprotocol/uniswap-position-quoter v1.0.7
Uniswap Position Quoter
Description
Steer Position Quoter provides re-balance calculations for multi position strategies with 99% accuracy.
How to install
Node Package Manager
npm install --save @steerprotocol/uniswap-position-quoter
Yarn
yarn add @steerprotocol/uniswap-position-quoter
How to use
import {CustomRouter, Position} from '@steerprotocol/uniswap-position-quoter'
import {utils} from 'ethers'
const QUOTER_ADDRESS = '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6'
const POOL_ADDRESS = '0x0000000000000000000000000000000000000000'
const TOKEN0_ADDRESS = '0x0000000000000000000000000000000000000000'
const TOKEN1_ADDRESS = '0x0000000000000000000000000000000000000000'
const POOL_FEE = '3000'
const quoterContract = new Contract(
QUOTER_ADDRESS,
new Interface(QuoterV2Artifact.abi)
);
const PositionQuoter = new CustomRouter(quoterContract)
const positions = [
{
lowerTick: 62342,
upperTick: -62342,
weight: 1,
},
{
lowerTick: 32342,
upperTick: -32342,
weight: 3,
},
]
// Returns single swap amount to have proper liquidity for position re-balancing
const swapResult = await PositionQuoter.getSwapAmount(
POOL_ADDRESS,
positions,
utils.parseEther('100'),
utils.parseEther('100'),
TOKEN0_ADDRESS,
TOKEN1_ADDRESS,
POOL_FEE,
0,
)
1.0.7
12 months ago
1.0.6
12 months ago
1.0.5
12 months ago
1.0.4
1 year ago
1.0.2
2 years ago
1.0.3
2 years ago
0.0.8
2 years ago
1.0.2-alpha.2
2 years ago
1.0.2-alpha.3
2 years ago
1.0.3-alpha.1
2 years ago
0.0.7
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
1.0.0-beta.1
2 years ago
1.0.0-alpha.2
2 years ago
1.0.0-alpha.1
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago