/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */

import {
  ethers,
  EventFilter,
  Signer,
  BigNumber,
  BigNumberish,
  PopulatedTransaction,
  BaseContract,
  ContractTransaction,
  Overrides,
  CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import type { TypedEventFilter, TypedEvent, TypedListener } from "./common";

interface SwapInterface extends ethers.utils.Interface {
  functions: {
    "$borrow()": FunctionFragment;
    "OSD_PRICE()": FunctionFragment;
    "addLiquidity(address,uint256,address,uint256)": FunctionFragment;
    "borrow(address,uint256,address)": FunctionFragment;
    "dailyDebtCap(address)": FunctionFragment;
    "dailyMinted(address,uint256)": FunctionFragment;
    "feeRateUnverifiedPool(address)": FunctionFragment;
    "getAmountIn(address,address,uint256)": FunctionFragment;
    "getAmountOut(address,address,uint256)": FunctionFragment;
    "getAvailability(address)": FunctionFragment;
    "getFeeRates(address)": FunctionFragment;
    "getLiquidityIn(address,uint256)": FunctionFragment;
    "getLiquidityOut(address,uint256)": FunctionFragment;
    "getPoolFeePolicy(address)": FunctionFragment;
    "getPoolInfo(address)": FunctionFragment;
    "getPoolReserve(address)": FunctionFragment;
    "getPoolState(address)": FunctionFragment;
    "getPoolTokenList()": FunctionFragment;
    "getPriceRatio(address)": FunctionFragment;
    "getRevenueOsd(address)": FunctionFragment;
    "listToken(address,uint256,uint256,address)": FunctionFragment;
    "osd()": FunctionFragment;
    "owner()": FunctionFragment;
    "poolTokenList(uint256)": FunctionFragment;
    "pools(address)": FunctionFragment;
    "priceFeed()": FunctionFragment;
    "protocolRevenueExtract(address,uint256,address)": FunctionFragment;
    "removeLiquidity(address,uint256,address,uint256)": FunctionFragment;
    "renounceOwnership()": FunctionFragment;
    "repay(address,uint256,address)": FunctionFragment;
    "setBorrow(address)": FunctionFragment;
    "setDailyDebtCap(address,uint256)": FunctionFragment;
    "setPriceFeed(address)": FunctionFragment;
    "setSystemRouter(address,bool)": FunctionFragment;
    "setUserRouter(address,bool)": FunctionFragment;
    "staleCoinMap(address)": FunctionFragment;
    "swapIn(address,address,uint256,uint256,address,uint256)": FunctionFragment;
    "swapOut(address,address,uint256,uint256,address,uint256)": FunctionFragment;
    "systemRouters(address)": FunctionFragment;
    "transferOwnership(address)": FunctionFragment;
    "updateFeeRateUnverifiedPool(address,uint16)": FunctionFragment;
    "updatePool(address,uint256,uint256,bool,bool,uint8,uint8,uint16[3])": FunctionFragment;
    "userRouters(address,address)": FunctionFragment;
    "withdrawRevenueOsd(address,address,uint256)": FunctionFragment;
  };

  encodeFunctionData(functionFragment: "$borrow", values?: undefined): string;
  encodeFunctionData(functionFragment: "OSD_PRICE", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "addLiquidity",
    values: [string, BigNumberish, string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "borrow",
    values: [string, BigNumberish, string]
  ): string;
  encodeFunctionData(
    functionFragment: "dailyDebtCap",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "dailyMinted",
    values: [string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "feeRateUnverifiedPool",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "getAmountIn",
    values: [string, string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getAmountOut",
    values: [string, string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getAvailability",
    values: [string]
  ): string;
  encodeFunctionData(functionFragment: "getFeeRates", values: [string]): string;
  encodeFunctionData(
    functionFragment: "getLiquidityIn",
    values: [string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getLiquidityOut",
    values: [string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getPoolFeePolicy",
    values: [string]
  ): string;
  encodeFunctionData(functionFragment: "getPoolInfo", values: [string]): string;
  encodeFunctionData(
    functionFragment: "getPoolReserve",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "getPoolState",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "getPoolTokenList",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "getPriceRatio",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "getRevenueOsd",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "listToken",
    values: [string, BigNumberish, BigNumberish, string]
  ): string;
  encodeFunctionData(functionFragment: "osd", values?: undefined): string;
  encodeFunctionData(functionFragment: "owner", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "poolTokenList",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(functionFragment: "pools", values: [string]): string;
  encodeFunctionData(functionFragment: "priceFeed", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "protocolRevenueExtract",
    values: [string, BigNumberish, string]
  ): string;
  encodeFunctionData(
    functionFragment: "removeLiquidity",
    values: [string, BigNumberish, string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "renounceOwnership",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "repay",
    values: [string, BigNumberish, string]
  ): string;
  encodeFunctionData(functionFragment: "setBorrow", values: [string]): string;
  encodeFunctionData(
    functionFragment: "setDailyDebtCap",
    values: [string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "setPriceFeed",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "setSystemRouter",
    values: [string, boolean]
  ): string;
  encodeFunctionData(
    functionFragment: "setUserRouter",
    values: [string, boolean]
  ): string;
  encodeFunctionData(
    functionFragment: "staleCoinMap",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "swapIn",
    values: [string, string, BigNumberish, BigNumberish, string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "swapOut",
    values: [string, string, BigNumberish, BigNumberish, string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "systemRouters",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "transferOwnership",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "updateFeeRateUnverifiedPool",
    values: [string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "updatePool",
    values: [
      string,
      BigNumberish,
      BigNumberish,
      boolean,
      boolean,
      BigNumberish,
      BigNumberish,
      [BigNumberish, BigNumberish, BigNumberish]
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "userRouters",
    values: [string, string]
  ): string;
  encodeFunctionData(
    functionFragment: "withdrawRevenueOsd",
    values: [string, string, BigNumberish]
  ): string;

  decodeFunctionResult(functionFragment: "$borrow", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "OSD_PRICE", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "addLiquidity",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "borrow", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "dailyDebtCap",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "dailyMinted",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "feeRateUnverifiedPool",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getAmountIn",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getAmountOut",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getAvailability",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getFeeRates",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getLiquidityIn",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getLiquidityOut",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getPoolFeePolicy",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getPoolInfo",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getPoolReserve",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getPoolState",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getPoolTokenList",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getPriceRatio",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getRevenueOsd",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "listToken", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "osd", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "poolTokenList",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "pools", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "priceFeed", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "protocolRevenueExtract",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "removeLiquidity",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "renounceOwnership",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "repay", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "setBorrow", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "setDailyDebtCap",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "setPriceFeed",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "setSystemRouter",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "setUserRouter",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "staleCoinMap",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "swapIn", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "swapOut", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "systemRouters",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "transferOwnership",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "updateFeeRateUnverifiedPool",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "updatePool", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "userRouters",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "withdrawRevenueOsd",
    data: BytesLike
  ): Result;

  events: {
    "AddLiquidity(address,uint256,uint256,address)": EventFragment;
    "CaptureSwapFee(address,uint256,uint256)": EventFragment;
    "OwnershipTransferred(address,address)": EventFragment;
    "PoolAmountUpdated(address,uint256,uint256,uint256,uint256)": EventFragment;
    "Rebalance(address,uint256,uint256)": EventFragment;
    "RemoveLiquidity(address,uint256,uint256,address)": EventFragment;
    "SetSystemRouter(address,bool)": EventFragment;
    "Swapped(address,address,address,uint256,uint256,address)": EventFragment;
    "SwappedSingle(address,address,uint256,uint256,uint8)": EventFragment;
    "TokenListed(address,address)": EventFragment;
    "WithdrawRevenueOsd(address,uint256,address)": EventFragment;
  };

  getEvent(nameOrSignatureOrTopic: "AddLiquidity"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "CaptureSwapFee"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "PoolAmountUpdated"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "Rebalance"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "RemoveLiquidity"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "SetSystemRouter"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "Swapped"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "SwappedSingle"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "TokenListed"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "WithdrawRevenueOsd"): EventFragment;
}

export type AddLiquidityEvent = TypedEvent<
  [string, BigNumber, BigNumber, string] & {
    token: string;
    tokenAmount: BigNumber;
    lpTokenAmount: BigNumber;
    to: string;
  }
>;

export type CaptureSwapFeeEvent = TypedEvent<
  [string, BigNumber, BigNumber] & {
    token: string;
    protocolFee: BigNumber;
    liquidityFee: BigNumber;
  }
>;

export type OwnershipTransferredEvent = TypedEvent<
  [string, string] & { previousOwner: string; newOwner: string }
>;

export type PoolAmountUpdatedEvent = TypedEvent<
  [string, BigNumber, BigNumber, BigNumber, BigNumber] & {
    token: string;
    reserve: BigNumber;
    osd: BigNumber;
    ratioToken: BigNumber;
    ratioOsd: BigNumber;
  }
>;

export type RebalanceEvent = TypedEvent<
  [string, BigNumber, BigNumber] & {
    token: string;
    osdAmount: BigNumber;
    lpAmount: BigNumber;
  }
>;

export type RemoveLiquidityEvent = TypedEvent<
  [string, BigNumber, BigNumber, string] & {
    token: string;
    tokenAmount: BigNumber;
    osdAmount: BigNumber;
    to: string;
  }
>;

export type SetSystemRouterEvent = TypedEvent<
  [string, boolean] & { router: string; allowed: boolean }
>;

export type SwappedEvent = TypedEvent<
  [string, string, string, BigNumber, BigNumber, string] & {
    sender: string;
    tokenIn: string;
    tokenOut: string;
    amountIn: BigNumber;
    amountOut: BigNumber;
    to: string;
  }
>;

export type SwappedSingleEvent = TypedEvent<
  [string, string, BigNumber, BigNumber, number] & {
    sender: string;
    token: string;
    amountIn: BigNumber;
    amountOut: BigNumber;
    orderType: number;
  }
>;

export type TokenListedEvent = TypedEvent<
  [string, string] & { token: string; liquidity: string }
>;

export type WithdrawRevenueOsdEvent = TypedEvent<
  [string, BigNumber, string] & { token: string; amount: BigNumber; to: string }
>;

export class Swap extends BaseContract {
  connect(signerOrProvider: Signer | Provider | string): this;
  attach(addressOrName: string): this;
  deployed(): Promise<this>;

  listeners<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
  ): Array<TypedListener<EventArgsArray, EventArgsObject>>;
  off<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  on<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  once<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
  ): this;

  listeners(eventName?: string): Array<Listener>;
  off(eventName: string, listener: Listener): this;
  on(eventName: string, listener: Listener): this;
  once(eventName: string, listener: Listener): this;
  removeListener(eventName: string, listener: Listener): this;
  removeAllListeners(eventName?: string): this;

  queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
    event: TypedEventFilter<EventArgsArray, EventArgsObject>,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined
  ): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;

  interface: SwapInterface;

  functions: {
    $borrow(overrides?: CallOverrides): Promise<[string]>;

    OSD_PRICE(overrides?: CallOverrides): Promise<[BigNumber]>;

    addLiquidity(
      token: string,
      amount: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    borrow(
      token: string,
      amount: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    dailyDebtCap(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>;

    dailyMinted(
      arg0: string,
      arg1: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    feeRateUnverifiedPool(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<[number]>;

    getAmountIn(
      tokenIn: string,
      tokenOut: string,
      amountOut: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber] & { amountIn: BigNumber }>;

    getAmountOut(
      tokenIn: string,
      tokenOut: string,
      amountIn: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber] & { amountOut: BigNumber }>;

    getAvailability(
      token: string,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    getFeeRates(
      token: string,
      overrides?: CallOverrides
    ): Promise<[[number, number, number]]>;

    getLiquidityIn(
      token: string,
      liquidity: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber, BigNumber]>;

    getLiquidityOut(
      token: string,
      amount: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    getPoolFeePolicy(
      token: string,
      overrides?: CallOverrides
    ): Promise<
      [number, number, number, number, number, BigNumber] & {
        feeType: number;
        feeRate0: number;
        feeRate1: number;
        feeRate2: number;
        revenueRate: number;
        revenueOsd: BigNumber;
      }
    >;

    getPoolInfo(
      token: string,
      overrides?: CallOverrides
    ): Promise<
      [string, BigNumber, boolean, boolean] & {
        liquidity: string;
        createdAt: BigNumber;
        rebalancible: boolean;
        usePriceFeed: boolean;
      }
    >;

    getPoolReserve(
      token: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, BigNumber, BigNumber] & {
        reserveToken: BigNumber;
        reserveOsd: BigNumber;
        availableToken: BigNumber;
        availableOsd: BigNumber;
      }
    >;

    getPoolState(
      token: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, BigNumber, BigNumber] & {
        reserve: BigNumber;
        lastRatioToken: BigNumber;
        lastRatioOsd: BigNumber;
        osd_: BigNumber;
      }
    >;

    getPoolTokenList(overrides?: CallOverrides): Promise<[string[]]>;

    getPriceRatio(
      token: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber] & { tokenRatio: BigNumber; osdRatio: BigNumber }
    >;

    getRevenueOsd(
      token: string,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    listToken(
      token: string,
      amount: BigNumberish,
      amountOsd: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    osd(overrides?: CallOverrides): Promise<[string]>;

    owner(overrides?: CallOverrides): Promise<[string]>;

    poolTokenList(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[string]>;

    pools(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<
      [
        string,
        string,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        boolean,
        boolean,
        number,
        number,
        BigNumber,
        number
      ] & {
        token: string;
        liquidity: string;
        reserve: BigNumber;
        lastRatioToken: BigNumber;
        lastRatioOsd: BigNumber;
        osd: BigNumber;
        createdAt: BigNumber;
        rebalancible: boolean;
        usePriceFeed: boolean;
        feeType: number;
        revenueRate: number;
        revenueOsd: BigNumber;
        tokenDecimal: number;
      }
    >;

    priceFeed(overrides?: CallOverrides): Promise<[string]>;

    protocolRevenueExtract(
      token: string,
      amount: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    removeLiquidity(
      token: string,
      liquidity: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    repay(
      token: string,
      amount: BigNumberish,
      from: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    setBorrow(
      _borrow: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    setDailyDebtCap(
      _token: string,
      _cap: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    setPriceFeed(
      _priceFeed: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    setSystemRouter(
      _router: string,
      allowed: boolean,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    setUserRouter(
      _router: string,
      allowed: boolean,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    staleCoinMap(arg0: string, overrides?: CallOverrides): Promise<[boolean]>;

    swapIn(
      tokenIn: string,
      tokenOut: string,
      amountIn: BigNumberish,
      amountOutMin: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    swapOut(
      tokenIn: string,
      tokenOut: string,
      amountInMax: BigNumberish,
      amountOut: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    systemRouters(arg0: string, overrides?: CallOverrides): Promise<[boolean]>;

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    updateFeeRateUnverifiedPool(
      token: string,
      feeSaleByUser: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    updatePool(
      token: string,
      lastRatioToken: BigNumberish,
      lastRatioOsd: BigNumberish,
      rebalancible: boolean,
      usePriceFeed: boolean,
      feeType: BigNumberish,
      revenueRate: BigNumberish,
      feeRates: [BigNumberish, BigNumberish, BigNumberish],
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    userRouters(
      arg0: string,
      arg1: string,
      overrides?: CallOverrides
    ): Promise<[boolean]>;

    withdrawRevenueOsd(
      token: string,
      to: string,
      amount: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;
  };

  $borrow(overrides?: CallOverrides): Promise<string>;

  OSD_PRICE(overrides?: CallOverrides): Promise<BigNumber>;

  addLiquidity(
    token: string,
    amount: BigNumberish,
    to: string,
    deadline: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  borrow(
    token: string,
    amount: BigNumberish,
    to: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  dailyDebtCap(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;

  dailyMinted(
    arg0: string,
    arg1: BigNumberish,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  feeRateUnverifiedPool(
    arg0: string,
    overrides?: CallOverrides
  ): Promise<number>;

  getAmountIn(
    tokenIn: string,
    tokenOut: string,
    amountOut: BigNumberish,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  getAmountOut(
    tokenIn: string,
    tokenOut: string,
    amountIn: BigNumberish,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  getAvailability(token: string, overrides?: CallOverrides): Promise<BigNumber>;

  getFeeRates(
    token: string,
    overrides?: CallOverrides
  ): Promise<[number, number, number]>;

  getLiquidityIn(
    token: string,
    liquidity: BigNumberish,
    overrides?: CallOverrides
  ): Promise<[BigNumber, BigNumber]>;

  getLiquidityOut(
    token: string,
    amount: BigNumberish,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  getPoolFeePolicy(
    token: string,
    overrides?: CallOverrides
  ): Promise<
    [number, number, number, number, number, BigNumber] & {
      feeType: number;
      feeRate0: number;
      feeRate1: number;
      feeRate2: number;
      revenueRate: number;
      revenueOsd: BigNumber;
    }
  >;

  getPoolInfo(
    token: string,
    overrides?: CallOverrides
  ): Promise<
    [string, BigNumber, boolean, boolean] & {
      liquidity: string;
      createdAt: BigNumber;
      rebalancible: boolean;
      usePriceFeed: boolean;
    }
  >;

  getPoolReserve(
    token: string,
    overrides?: CallOverrides
  ): Promise<
    [BigNumber, BigNumber, BigNumber, BigNumber] & {
      reserveToken: BigNumber;
      reserveOsd: BigNumber;
      availableToken: BigNumber;
      availableOsd: BigNumber;
    }
  >;

  getPoolState(
    token: string,
    overrides?: CallOverrides
  ): Promise<
    [BigNumber, BigNumber, BigNumber, BigNumber] & {
      reserve: BigNumber;
      lastRatioToken: BigNumber;
      lastRatioOsd: BigNumber;
      osd_: BigNumber;
    }
  >;

  getPoolTokenList(overrides?: CallOverrides): Promise<string[]>;

  getPriceRatio(
    token: string,
    overrides?: CallOverrides
  ): Promise<
    [BigNumber, BigNumber] & { tokenRatio: BigNumber; osdRatio: BigNumber }
  >;

  getRevenueOsd(token: string, overrides?: CallOverrides): Promise<BigNumber>;

  listToken(
    token: string,
    amount: BigNumberish,
    amountOsd: BigNumberish,
    to: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  osd(overrides?: CallOverrides): Promise<string>;

  owner(overrides?: CallOverrides): Promise<string>;

  poolTokenList(arg0: BigNumberish, overrides?: CallOverrides): Promise<string>;

  pools(
    arg0: string,
    overrides?: CallOverrides
  ): Promise<
    [
      string,
      string,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      boolean,
      boolean,
      number,
      number,
      BigNumber,
      number
    ] & {
      token: string;
      liquidity: string;
      reserve: BigNumber;
      lastRatioToken: BigNumber;
      lastRatioOsd: BigNumber;
      osd: BigNumber;
      createdAt: BigNumber;
      rebalancible: boolean;
      usePriceFeed: boolean;
      feeType: number;
      revenueRate: number;
      revenueOsd: BigNumber;
      tokenDecimal: number;
    }
  >;

  priceFeed(overrides?: CallOverrides): Promise<string>;

  protocolRevenueExtract(
    token: string,
    amount: BigNumberish,
    to: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  removeLiquidity(
    token: string,
    liquidity: BigNumberish,
    to: string,
    deadline: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  renounceOwnership(
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  repay(
    token: string,
    amount: BigNumberish,
    from: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  setBorrow(
    _borrow: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  setDailyDebtCap(
    _token: string,
    _cap: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  setPriceFeed(
    _priceFeed: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  setSystemRouter(
    _router: string,
    allowed: boolean,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  setUserRouter(
    _router: string,
    allowed: boolean,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  staleCoinMap(arg0: string, overrides?: CallOverrides): Promise<boolean>;

  swapIn(
    tokenIn: string,
    tokenOut: string,
    amountIn: BigNumberish,
    amountOutMin: BigNumberish,
    to: string,
    deadline: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  swapOut(
    tokenIn: string,
    tokenOut: string,
    amountInMax: BigNumberish,
    amountOut: BigNumberish,
    to: string,
    deadline: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  systemRouters(arg0: string, overrides?: CallOverrides): Promise<boolean>;

  transferOwnership(
    newOwner: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  updateFeeRateUnverifiedPool(
    token: string,
    feeSaleByUser: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  updatePool(
    token: string,
    lastRatioToken: BigNumberish,
    lastRatioOsd: BigNumberish,
    rebalancible: boolean,
    usePriceFeed: boolean,
    feeType: BigNumberish,
    revenueRate: BigNumberish,
    feeRates: [BigNumberish, BigNumberish, BigNumberish],
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  userRouters(
    arg0: string,
    arg1: string,
    overrides?: CallOverrides
  ): Promise<boolean>;

  withdrawRevenueOsd(
    token: string,
    to: string,
    amount: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  callStatic: {
    $borrow(overrides?: CallOverrides): Promise<string>;

    OSD_PRICE(overrides?: CallOverrides): Promise<BigNumber>;

    addLiquidity(
      token: string,
      amount: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    borrow(
      token: string,
      amount: BigNumberish,
      to: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    dailyDebtCap(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;

    dailyMinted(
      arg0: string,
      arg1: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    feeRateUnverifiedPool(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<number>;

    getAmountIn(
      tokenIn: string,
      tokenOut: string,
      amountOut: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getAmountOut(
      tokenIn: string,
      tokenOut: string,
      amountIn: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getAvailability(
      token: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getFeeRates(
      token: string,
      overrides?: CallOverrides
    ): Promise<[number, number, number]>;

    getLiquidityIn(
      token: string,
      liquidity: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber, BigNumber]>;

    getLiquidityOut(
      token: string,
      amount: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getPoolFeePolicy(
      token: string,
      overrides?: CallOverrides
    ): Promise<
      [number, number, number, number, number, BigNumber] & {
        feeType: number;
        feeRate0: number;
        feeRate1: number;
        feeRate2: number;
        revenueRate: number;
        revenueOsd: BigNumber;
      }
    >;

    getPoolInfo(
      token: string,
      overrides?: CallOverrides
    ): Promise<
      [string, BigNumber, boolean, boolean] & {
        liquidity: string;
        createdAt: BigNumber;
        rebalancible: boolean;
        usePriceFeed: boolean;
      }
    >;

    getPoolReserve(
      token: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, BigNumber, BigNumber] & {
        reserveToken: BigNumber;
        reserveOsd: BigNumber;
        availableToken: BigNumber;
        availableOsd: BigNumber;
      }
    >;

    getPoolState(
      token: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, BigNumber, BigNumber] & {
        reserve: BigNumber;
        lastRatioToken: BigNumber;
        lastRatioOsd: BigNumber;
        osd_: BigNumber;
      }
    >;

    getPoolTokenList(overrides?: CallOverrides): Promise<string[]>;

    getPriceRatio(
      token: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber] & { tokenRatio: BigNumber; osdRatio: BigNumber }
    >;

    getRevenueOsd(token: string, overrides?: CallOverrides): Promise<BigNumber>;

    listToken(
      token: string,
      amount: BigNumberish,
      amountOsd: BigNumberish,
      to: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    osd(overrides?: CallOverrides): Promise<string>;

    owner(overrides?: CallOverrides): Promise<string>;

    poolTokenList(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<string>;

    pools(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<
      [
        string,
        string,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        boolean,
        boolean,
        number,
        number,
        BigNumber,
        number
      ] & {
        token: string;
        liquidity: string;
        reserve: BigNumber;
        lastRatioToken: BigNumber;
        lastRatioOsd: BigNumber;
        osd: BigNumber;
        createdAt: BigNumber;
        rebalancible: boolean;
        usePriceFeed: boolean;
        feeType: number;
        revenueRate: number;
        revenueOsd: BigNumber;
        tokenDecimal: number;
      }
    >;

    priceFeed(overrides?: CallOverrides): Promise<string>;

    protocolRevenueExtract(
      token: string,
      amount: BigNumberish,
      to: string,
      overrides?: CallOverrides
    ): Promise<boolean>;

    removeLiquidity(
      token: string,
      liquidity: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber, BigNumber]>;

    renounceOwnership(overrides?: CallOverrides): Promise<void>;

    repay(
      token: string,
      amount: BigNumberish,
      from: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    setBorrow(_borrow: string, overrides?: CallOverrides): Promise<void>;

    setDailyDebtCap(
      _token: string,
      _cap: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    setPriceFeed(_priceFeed: string, overrides?: CallOverrides): Promise<void>;

    setSystemRouter(
      _router: string,
      allowed: boolean,
      overrides?: CallOverrides
    ): Promise<void>;

    setUserRouter(
      _router: string,
      allowed: boolean,
      overrides?: CallOverrides
    ): Promise<void>;

    staleCoinMap(arg0: string, overrides?: CallOverrides): Promise<boolean>;

    swapIn(
      tokenIn: string,
      tokenOut: string,
      amountIn: BigNumberish,
      amountOutMin: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber, BigNumber]>;

    swapOut(
      tokenIn: string,
      tokenOut: string,
      amountInMax: BigNumberish,
      amountOut: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber, BigNumber]>;

    systemRouters(arg0: string, overrides?: CallOverrides): Promise<boolean>;

    transferOwnership(
      newOwner: string,
      overrides?: CallOverrides
    ): Promise<void>;

    updateFeeRateUnverifiedPool(
      token: string,
      feeSaleByUser: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    updatePool(
      token: string,
      lastRatioToken: BigNumberish,
      lastRatioOsd: BigNumberish,
      rebalancible: boolean,
      usePriceFeed: boolean,
      feeType: BigNumberish,
      revenueRate: BigNumberish,
      feeRates: [BigNumberish, BigNumberish, BigNumberish],
      overrides?: CallOverrides
    ): Promise<void>;

    userRouters(
      arg0: string,
      arg1: string,
      overrides?: CallOverrides
    ): Promise<boolean>;

    withdrawRevenueOsd(
      token: string,
      to: string,
      amount: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;
  };

  filters: {
    "AddLiquidity(address,uint256,uint256,address)"(
      token?: string | null,
      tokenAmount?: null,
      lpTokenAmount?: null,
      to?: string | null
    ): TypedEventFilter<
      [string, BigNumber, BigNumber, string],
      {
        token: string;
        tokenAmount: BigNumber;
        lpTokenAmount: BigNumber;
        to: string;
      }
    >;

    AddLiquidity(
      token?: string | null,
      tokenAmount?: null,
      lpTokenAmount?: null,
      to?: string | null
    ): TypedEventFilter<
      [string, BigNumber, BigNumber, string],
      {
        token: string;
        tokenAmount: BigNumber;
        lpTokenAmount: BigNumber;
        to: string;
      }
    >;

    "CaptureSwapFee(address,uint256,uint256)"(
      token?: string | null,
      protocolFee?: null,
      liquidityFee?: null
    ): TypedEventFilter<
      [string, BigNumber, BigNumber],
      { token: string; protocolFee: BigNumber; liquidityFee: BigNumber }
    >;

    CaptureSwapFee(
      token?: string | null,
      protocolFee?: null,
      liquidityFee?: null
    ): TypedEventFilter<
      [string, BigNumber, BigNumber],
      { token: string; protocolFee: BigNumber; liquidityFee: BigNumber }
    >;

    "OwnershipTransferred(address,address)"(
      previousOwner?: string | null,
      newOwner?: string | null
    ): TypedEventFilter<
      [string, string],
      { previousOwner: string; newOwner: string }
    >;

    OwnershipTransferred(
      previousOwner?: string | null,
      newOwner?: string | null
    ): TypedEventFilter<
      [string, string],
      { previousOwner: string; newOwner: string }
    >;

    "PoolAmountUpdated(address,uint256,uint256,uint256,uint256)"(
      token?: string | null,
      reserve?: null,
      osd?: null,
      ratioToken?: null,
      ratioOsd?: null
    ): TypedEventFilter<
      [string, BigNumber, BigNumber, BigNumber, BigNumber],
      {
        token: string;
        reserve: BigNumber;
        osd: BigNumber;
        ratioToken: BigNumber;
        ratioOsd: BigNumber;
      }
    >;

    PoolAmountUpdated(
      token?: string | null,
      reserve?: null,
      osd?: null,
      ratioToken?: null,
      ratioOsd?: null
    ): TypedEventFilter<
      [string, BigNumber, BigNumber, BigNumber, BigNumber],
      {
        token: string;
        reserve: BigNumber;
        osd: BigNumber;
        ratioToken: BigNumber;
        ratioOsd: BigNumber;
      }
    >;

    "Rebalance(address,uint256,uint256)"(
      token?: string | null,
      osdAmount?: null,
      lpAmount?: null
    ): TypedEventFilter<
      [string, BigNumber, BigNumber],
      { token: string; osdAmount: BigNumber; lpAmount: BigNumber }
    >;

    Rebalance(
      token?: string | null,
      osdAmount?: null,
      lpAmount?: null
    ): TypedEventFilter<
      [string, BigNumber, BigNumber],
      { token: string; osdAmount: BigNumber; lpAmount: BigNumber }
    >;

    "RemoveLiquidity(address,uint256,uint256,address)"(
      token?: string | null,
      tokenAmount?: null,
      osdAmount?: null,
      to?: string | null
    ): TypedEventFilter<
      [string, BigNumber, BigNumber, string],
      {
        token: string;
        tokenAmount: BigNumber;
        osdAmount: BigNumber;
        to: string;
      }
    >;

    RemoveLiquidity(
      token?: string | null,
      tokenAmount?: null,
      osdAmount?: null,
      to?: string | null
    ): TypedEventFilter<
      [string, BigNumber, BigNumber, string],
      {
        token: string;
        tokenAmount: BigNumber;
        osdAmount: BigNumber;
        to: string;
      }
    >;

    "SetSystemRouter(address,bool)"(
      router?: null,
      allowed?: null
    ): TypedEventFilter<
      [string, boolean],
      { router: string; allowed: boolean }
    >;

    SetSystemRouter(
      router?: null,
      allowed?: null
    ): TypedEventFilter<
      [string, boolean],
      { router: string; allowed: boolean }
    >;

    "Swapped(address,address,address,uint256,uint256,address)"(
      sender?: string | null,
      tokenIn?: null,
      tokenOut?: null,
      amountIn?: null,
      amountOut?: null,
      to?: string | null
    ): TypedEventFilter<
      [string, string, string, BigNumber, BigNumber, string],
      {
        sender: string;
        tokenIn: string;
        tokenOut: string;
        amountIn: BigNumber;
        amountOut: BigNumber;
        to: string;
      }
    >;

    Swapped(
      sender?: string | null,
      tokenIn?: null,
      tokenOut?: null,
      amountIn?: null,
      amountOut?: null,
      to?: string | null
    ): TypedEventFilter<
      [string, string, string, BigNumber, BigNumber, string],
      {
        sender: string;
        tokenIn: string;
        tokenOut: string;
        amountIn: BigNumber;
        amountOut: BigNumber;
        to: string;
      }
    >;

    "SwappedSingle(address,address,uint256,uint256,uint8)"(
      sender?: string | null,
      token?: null,
      amountIn?: null,
      amountOut?: null,
      orderType?: null
    ): TypedEventFilter<
      [string, string, BigNumber, BigNumber, number],
      {
        sender: string;
        token: string;
        amountIn: BigNumber;
        amountOut: BigNumber;
        orderType: number;
      }
    >;

    SwappedSingle(
      sender?: string | null,
      token?: null,
      amountIn?: null,
      amountOut?: null,
      orderType?: null
    ): TypedEventFilter<
      [string, string, BigNumber, BigNumber, number],
      {
        sender: string;
        token: string;
        amountIn: BigNumber;
        amountOut: BigNumber;
        orderType: number;
      }
    >;

    "TokenListed(address,address)"(
      token?: string | null,
      liquidity?: null
    ): TypedEventFilter<[string, string], { token: string; liquidity: string }>;

    TokenListed(
      token?: string | null,
      liquidity?: null
    ): TypedEventFilter<[string, string], { token: string; liquidity: string }>;

    "WithdrawRevenueOsd(address,uint256,address)"(
      token?: string | null,
      amount?: null,
      to?: string | null
    ): TypedEventFilter<
      [string, BigNumber, string],
      { token: string; amount: BigNumber; to: string }
    >;

    WithdrawRevenueOsd(
      token?: string | null,
      amount?: null,
      to?: string | null
    ): TypedEventFilter<
      [string, BigNumber, string],
      { token: string; amount: BigNumber; to: string }
    >;
  };

  estimateGas: {
    $borrow(overrides?: CallOverrides): Promise<BigNumber>;

    OSD_PRICE(overrides?: CallOverrides): Promise<BigNumber>;

    addLiquidity(
      token: string,
      amount: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    borrow(
      token: string,
      amount: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    dailyDebtCap(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;

    dailyMinted(
      arg0: string,
      arg1: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    feeRateUnverifiedPool(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getAmountIn(
      tokenIn: string,
      tokenOut: string,
      amountOut: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getAmountOut(
      tokenIn: string,
      tokenOut: string,
      amountIn: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getAvailability(
      token: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getFeeRates(token: string, overrides?: CallOverrides): Promise<BigNumber>;

    getLiquidityIn(
      token: string,
      liquidity: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getLiquidityOut(
      token: string,
      amount: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getPoolFeePolicy(
      token: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getPoolInfo(token: string, overrides?: CallOverrides): Promise<BigNumber>;

    getPoolReserve(
      token: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getPoolState(token: string, overrides?: CallOverrides): Promise<BigNumber>;

    getPoolTokenList(overrides?: CallOverrides): Promise<BigNumber>;

    getPriceRatio(token: string, overrides?: CallOverrides): Promise<BigNumber>;

    getRevenueOsd(token: string, overrides?: CallOverrides): Promise<BigNumber>;

    listToken(
      token: string,
      amount: BigNumberish,
      amountOsd: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    osd(overrides?: CallOverrides): Promise<BigNumber>;

    owner(overrides?: CallOverrides): Promise<BigNumber>;

    poolTokenList(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    pools(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;

    priceFeed(overrides?: CallOverrides): Promise<BigNumber>;

    protocolRevenueExtract(
      token: string,
      amount: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    removeLiquidity(
      token: string,
      liquidity: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    repay(
      token: string,
      amount: BigNumberish,
      from: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    setBorrow(
      _borrow: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    setDailyDebtCap(
      _token: string,
      _cap: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    setPriceFeed(
      _priceFeed: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    setSystemRouter(
      _router: string,
      allowed: boolean,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    setUserRouter(
      _router: string,
      allowed: boolean,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    staleCoinMap(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;

    swapIn(
      tokenIn: string,
      tokenOut: string,
      amountIn: BigNumberish,
      amountOutMin: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    swapOut(
      tokenIn: string,
      tokenOut: string,
      amountInMax: BigNumberish,
      amountOut: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    systemRouters(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    updateFeeRateUnverifiedPool(
      token: string,
      feeSaleByUser: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    updatePool(
      token: string,
      lastRatioToken: BigNumberish,
      lastRatioOsd: BigNumberish,
      rebalancible: boolean,
      usePriceFeed: boolean,
      feeType: BigNumberish,
      revenueRate: BigNumberish,
      feeRates: [BigNumberish, BigNumberish, BigNumberish],
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    userRouters(
      arg0: string,
      arg1: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    withdrawRevenueOsd(
      token: string,
      to: string,
      amount: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;
  };

  populateTransaction: {
    $borrow(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    OSD_PRICE(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    addLiquidity(
      token: string,
      amount: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    borrow(
      token: string,
      amount: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    dailyDebtCap(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    dailyMinted(
      arg0: string,
      arg1: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    feeRateUnverifiedPool(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getAmountIn(
      tokenIn: string,
      tokenOut: string,
      amountOut: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getAmountOut(
      tokenIn: string,
      tokenOut: string,
      amountIn: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getAvailability(
      token: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getFeeRates(
      token: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getLiquidityIn(
      token: string,
      liquidity: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getLiquidityOut(
      token: string,
      amount: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getPoolFeePolicy(
      token: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getPoolInfo(
      token: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getPoolReserve(
      token: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getPoolState(
      token: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getPoolTokenList(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    getPriceRatio(
      token: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getRevenueOsd(
      token: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    listToken(
      token: string,
      amount: BigNumberish,
      amountOsd: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    osd(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    poolTokenList(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    pools(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    priceFeed(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    protocolRevenueExtract(
      token: string,
      amount: BigNumberish,
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    removeLiquidity(
      token: string,
      liquidity: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    repay(
      token: string,
      amount: BigNumberish,
      from: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    setBorrow(
      _borrow: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    setDailyDebtCap(
      _token: string,
      _cap: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    setPriceFeed(
      _priceFeed: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    setSystemRouter(
      _router: string,
      allowed: boolean,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    setUserRouter(
      _router: string,
      allowed: boolean,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    staleCoinMap(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    swapIn(
      tokenIn: string,
      tokenOut: string,
      amountIn: BigNumberish,
      amountOutMin: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    swapOut(
      tokenIn: string,
      tokenOut: string,
      amountInMax: BigNumberish,
      amountOut: BigNumberish,
      to: string,
      deadline: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    systemRouters(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    updateFeeRateUnverifiedPool(
      token: string,
      feeSaleByUser: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    updatePool(
      token: string,
      lastRatioToken: BigNumberish,
      lastRatioOsd: BigNumberish,
      rebalancible: boolean,
      usePriceFeed: boolean,
      feeType: BigNumberish,
      revenueRate: BigNumberish,
      feeRates: [BigNumberish, BigNumberish, BigNumberish],
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    userRouters(
      arg0: string,
      arg1: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    withdrawRevenueOsd(
      token: string,
      to: string,
      amount: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;
  };
}
