diff --git a/src/contracts/abis/UniswapPoolAbi.json b/src/contracts/abis/UniswapPoolAbi.json new file mode 100644 index 00000000..ae333698 --- /dev/null +++ b/src/contracts/abis/UniswapPoolAbi.json @@ -0,0 +1 @@ +[{"inputs":[],"name":"liquidity","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"slot0","outputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"internalType":"int24","name":"tick","type":"int24"},{"internalType":"uint16","name":"observationIndex","type":"uint16"},{"internalType":"uint16","name":"observationCardinality","type":"uint16"},{"internalType":"uint16","name":"observationCardinalityNext","type":"uint16"},{"internalType":"uint8","name":"feeProtocol","type":"uint8"},{"internalType":"bool","name":"unlocked","type":"bool"}],"stateMutability":"view","type":"function"}] diff --git a/src/contracts/abis/index.js b/src/contracts/abis/index.js index bc370684..26682fd7 100644 --- a/src/contracts/abis/index.js +++ b/src/contracts/abis/index.js @@ -10,6 +10,7 @@ import VestingEscrowAbi from './VestingEscrowAbi.json' import PrivateVaultAbi from './PrivateVaultAbi.json' import VaultFactoryAbi from './VaultFactoryAbi.json' import PriceOracleAbi from './PriceOracleAbi.json' +import UniswapPoolAbi from './UniswapPoolAbi.json' import SwiseTokenAbi from './SwiseTokenAbi.json' import Erc20VaultAbi from './Erc20VaultAbi.json' import MulticallAbi from './MulticallAbi.json' @@ -34,6 +35,7 @@ export { PrivateVaultAbi, VaultFactoryAbi, PriceOracleAbi, + UniswapPoolAbi, SwiseTokenAbi, Erc20VaultAbi, MulticallAbi, diff --git a/src/contracts/createContracts.ts b/src/contracts/createContracts.ts index 93a6f443..6d79a820 100644 --- a/src/contracts/createContracts.ts +++ b/src/contracts/createContracts.ts @@ -9,6 +9,7 @@ import { MulticallAbi, Erc20VaultAbi, SwiseTokenAbi, + UniswapPoolAbi, PriceOracleAbi, PrivateVaultAbi, VaultFactoryAbi, @@ -32,6 +33,7 @@ import type { PrivateVaultAbi as PrivateVaultType, Erc20VaultAbi as Erc20VaultAbiType, PriceOracleAbi as PriceOracleType, + UniswapPoolAbi as UniswapPoolType, SwiseTokenAbi as SwiseTokenType, MulticallAbi as MulticallType, MintTokenAbi as MintTokenType, @@ -127,6 +129,7 @@ export const createContracts = (input: CreateContractsInput) => { createMulticall: multicall(multicallContract as MulticallType), createErc20: (address: string) => createContract(address, Erc20Abi, provider), createVaultContract: (address: string) => createContract(address, VaultAbi, provider), + createUniswapPoolAbi: (address: string) => createContract(address, UniswapPoolAbi, provider), createUsdRateContract: (address: string) => createContract(address, UsdRateAbi, provider), createErc20VaultContract: (address: string) => createContract(address, Erc20VaultAbi, provider), createPrivateVaultContract: (address: string) => createContract(address, PrivateVaultAbi, provider), diff --git a/src/methods/utils/getSwiseUsdPrice.ts b/src/methods/utils/getSwiseUsdPrice.ts index deae18eb..414a11fd 100644 --- a/src/methods/utils/getSwiseUsdPrice.ts +++ b/src/methods/utils/getSwiseUsdPrice.ts @@ -9,11 +9,13 @@ type GetSwiseUsdPriceInput = { const getSwiseUsdPrice = async (input: GetSwiseUsdPriceInput) => { const { options } = input - const data = await backend.swise.fetchSwiseStatsQuery({ - url: apiUrls.getBackendUrl(options), - }) - - return data?.swiseStats?.price || '0' + // const data = await backend.swise.fetchSwiseStatsQuery({ + // url: apiUrls.getBackendUrl(options), + // }) + // + // return data?.swiseStats?.price || '0' + // TODO remove when backend will be ready + return '0.058806999999999998' }