
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
test-tcv-platform-sdk
Advanced tools
- [Table of contents](#table-of-contents) - [TCV PLATFORM SDK](#tcv-platform-sdk) - [TCV](#tcv) - [getPoolTCV](#get-pool-tcv) - [getInfoVaultToken](#get-info-vault-token) - [getInfoVaultManager](#get-info-vault-manager) - [getInfoVaultRa
import {TCV} from "tcv-platform-sdk"
Information about one vault
const tcv = new TCV(_wallet, _TCVAddress);
const poolsInVault = await tcv.getPoolTCV();
const token0AndToken1InVault = await tcv.getInfoVaultToken();
const manager = await tcv.getInfoVaultManager();
const rangesSetInVault = await tcv.getInfoVaultRanges();
Information about vaults have been deployed
const tcvFactory = new TCVFactory( _wallet, _chainId );
const deployVault = await tcvFactory.deployVault(
feeTier,
token0,
token1,
owner,
init0,
init1,
manager,
routers,
isBeacon
)
const getVaults = await tcvFactory.getVaults(startIndex, endIndex);
const numVaults = await tcvFactory.getNumVaults();
Get info Vault when addLiqudity or removeLiquidity in a pool in uniswap v3 Function amountsForAddLiquidity return amount of token0 and token1 when addLiquidity ( display amount when adding )
Function liquidityForAmounts will return amount of liquidity when add with amount of token0, and token1
Function getPoolAddress to get address the pool which vault add liquidity
Functon getPosition get liquidity, token0Owed, token1Owed in pool address with positionId is id of vault with range
Function getAmountInOther return amount of token1 in token0 when token0 is base Assest( ust or wbnb) ( for example meaning 1 cake = 10 usdt )
Function PriceInOther wil get price of token1 in token0(base Assest token (usdt, wbnb))
Function getPriceLp => get price of lp token in usdt
Function get getTVL => get amount tvl in usdt
Function get amountsForRemoveLiquidity when proving amountMin0, amountMin1 it will return the amount liquidity to burn and amount0, amount1
=> if funcitons require lowertick, uppertick, feetier, you need to get information about range in funciton getInfoVaultRanges, if range is a array all this do with for loop
const uniswapv3 = new UniswapV3(_wallet, _chainId );
Get amount0, amount1 when provide amount of one token
const amountReturn = await uniswapv3.amountsForAddLiquidity(
slippage: number,
zeroToOne: boolean, // mean what token input first
amountMax: uint256,
token0: EthAddress,
token1: EthAddress,
lowerTick: uint256,
upperTick: uint256,
feeTier: uint256
)
const getTVLTokens = await uniswapv3.getPosition(
addressPool: EthAddress,
addressTCVVault: EthAddress,
lowerTick: uint256,
upperTick: uint256)
const poolAddress = await uniswapv3.getPoolAddress( token0, token1, feeTier);
Function return amount of liquidity, token0, token1, feeTier, lowerTick, upperTick, you can get from vault info amount0, amount1 is return of funciton amountsForAddLiquidity
const amount = await uniswapv3.liquidityForAmounts(
token0: EthAddress,
token1: EthAddress,
feeTier: uint256,
lowerTick: uint256,
upperTick: uint256,
amount0: uint256,
amount1: uint256)
input token0 is base assest token wanted to change token1 into token0
const amount = await uniswap.getAmountInOther(
amountIn: uint256,
slippage: number,
token0: EthAddress,
token1: EthAddress,
feeTier: uint256)
input token0 is base assest token wanted to change token1 into token0
const price = await uniswap.getPriceInOther(
slippage: number,
token0: EthAddress,
token1: EthAddress,
feeTier: uint256)
const priceLP = await uniswap.getPriceLP(
tcvVault:EthAddress,
feeTier: uint256,
lowerTick:uint256,
upperTick: uint256)
const tvl = await uniswap.getTVL(
tcvVault:EthAddress,
feeTier: uint256,
lowerTick:uint256,
upperTick: uint256)
return amount of liquidity to remove with provide of amount0Min, amount1Min
const amountBurn = await uniswap.(
amount0Min: uint256,
amount1Min: uint256,
token0: EthAddress,
token1: EthAddress,
lowerTick: uint256,
upperTick: uint256,
feeTier: uint256)
Router for user to add liquidity, remove liquidity receiver address is zero_address if you won't stake to vault if stake, it will be address of vault stake
Function removeLiquidity provide amountBurn, this amount you need to get in first element of array from function amountsForRemoveLiquidity in uniswap
const tcvRouter = new TCVRouter( _wallet, _chainId);
const addLiqudity = tcvRouter.addLiquidity(
amount0Max:uint256,
amount1Max:uint256,
vaultAddress:EthAddress,
receiver:EthAddress
)
const removeLiqudity = tcvRouter.removeLiquidity(
amountBurn:uint256,
amount0Min:EthAddress,
amount1Min:EthAddress,
vaultAddress:EthAddress,
receiver:EthAddress
)
FAQs
- [Table of contents](#table-of-contents) - [TCV PLATFORM SDK](#tcv-platform-sdk) - [TCV](#tcv) - [getPoolTCV](#get-pool-tcv) - [getInfoVaultToken](#get-info-vault-token) - [getInfoVaultManager](#get-info-vault-manager) - [getInfoVaultRa
The npm package test-tcv-platform-sdk receives a total of 6 weekly downloads. As such, test-tcv-platform-sdk popularity was classified as not popular.
We found that test-tcv-platform-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.