import { BigNumber, ethers, Wallet } from "ethers"; import { Dapp, LyraOptionMarket, LyraOptionType, LyraTradeType, Network, Reserves } from "../types"; import { Pool } from "."; import { Quote, Strike } from "@lyrafinance/lyra-js"; export declare class Utils { network: Network; signer: Wallet; constructor(network: Network, signer: Wallet); /** * Return the reserves of the two assets of a liquidity pool * This is the price of one token in the other * @param {Dapp} dApp DApp like Uniswap or Sushiswap * @param {string} tokenA First token of the pool pair * @param {string} tokenB Second token of the pool pair * @returns {Promise} Reserves of the assets in BigNumber * @throws If the dapp is not supported on the network */ getLpReserves(dapp: Dapp, assetA: string, assetB: string): Promise; /** * Returns the pool id of a liquidity pool * @param {Dapp} dApp DApp like uniswap or sushiswap * @param {string} lpPoolAddress token address of the pool pair * @returns {number} Pool Id * @throws if the dapp is not supported on the network */ getLpPoolId(dapp: Dapp, poolAsset: string): Promise; /** * Returns the balance of an asset (ERC20) token * @param {string} asset string token address * @param {string} owner address of the owner * @returns { BigNumber } Balance of asset */ getBalance(asset: string, owner: string): Promise; /** * Returns the decimals of an asset (ERC20) token * @param {string} asset string token address * @returns { number } Balance of asset */ getDecimals(asset: string): Promise; /** * Return the minimum amount out for a trade between two assets * given the trade amount and slippage * @param {Dapp} dApp DApp like Uniswap or Sushiswap * @param {string} assetFrom Asset to trade from * @param {string} assetTo Asset to trade into * @param {string | ethers.BigNumber} amountIn Trade amount * @param { number} slippage Maximum slippage allowed * @returns {Promise} Reserves of the assets in BigNumber */ getMinAmountOut(dapp: Dapp, assetFrom: string, assetTo: string, amountIn: string | ethers.BigNumber, slippage: number): Promise; /** * Build calldata for a Balancer swap. Routes through the Balancer SOR — picks * a single `swap` for direct hops or `batchSwap` for multi-hop routes. * `slippage` is in % (e.g. 0.5 = 0.5%). */ getBalancerSwapTx(pool: Pool, assetFrom: string, assetTo: string, amountIn: ethers.BigNumber | string, slippage: number): Promise; /** Build calldata to join a Balancer pool by depositing the given asset amounts. */ getBalancerJoinPoolTx(pool: Pool, balancerPoolId: string, assets: string[], amountsIn: string[] | ethers.BigNumber[]): Promise; /** * Build calldata to exit a Balancer pool. If `singleExitAssetIndex` is null * the exit is proportional across all `assets`; otherwise the BPT is redeemed * into the single asset at that index. */ getBalancerExitPoolTx(pool: Pool, balancerPoolId: string, assets: string[], singleExitAssetIndex: null | number, amount: string | ethers.BigNumber): Promise; /** List available expiry timestamps for a Lyra option market. */ getLyraOptionExpiries(market: LyraOptionMarket): Promise; /** List available strikes for a Lyra option market at a given expiry. */ getLyraOptionStrikes(market: LyraOptionMarket, expiry: number): Promise; /** Resolve a single Lyra strike by its strike price for a market/expiry. */ getLyraOptionStrike(market: LyraOptionMarket, expiry: number, strike: number): Promise; /** Get a Lyra option quote (premium, fees, slippage) for a strike/type/size. */ getLyraOptionQuote(strike: Strike, type: LyraOptionType, tradeType: LyraTradeType, amount: BigNumber | string): Promise; }