Hierarchy

  • default
    • Pool

Constructors

  • Parameters

    • address: string
    • provider: Provider

    Returns Pool

Properties

abi: any[]
address: string
bytecode: undefined | string
provider: Provider

Methods

  • Add liquidity to the pool

    Parameters

    • amountGMRX: bigint

      the amount of gMRX to add

    • minimum: bigint

      the minimum amount of LP tokens to receive as wei

    • allowHighSlippage: boolean = false

      allow high slippage that can result in trading fees

    • amountMRX: undefined | string = '0'

      the amount of MRX to send with the transaction and add as MRX

    • gasLimit: undefined | number = 250000

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Add liquidity to the pool

    Parameters

    • amountMRX: bigint

      the amount of wMRX to add as satoshi

    • amountGMRX: bigint

      the amount of gMRX to add as satoshi

    • minimum: bigint

      the minimum amount of LP tokens to receive as wei

    • allowHighSlippage: boolean = false

      allow high slippage that can result in trading fees

    • gasLimit: undefined | number = 250000

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Get this contract balance

    Returns Promise<bigint>

    the satoshi balance of this contract

  • Burn gMRX releasing wMRX or MRX

    Parameters

    • amountGMRX: bigint

      amount of gMRX to burn as satoshi

    • minimum: bigint

      the minimum amount of MRX or wMRX to receive as satoshi

    • unwrapMRX: boolean = false

      unwrap the wMRX to MRX

    • gasLimit: undefined | number = ...

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Perform calltocontract

    Parameters

    • method: string

      The contract method to call

    • args: any[]

      The arguments

    Returns Promise<undefined | Result>

    see Result

  • Get the g contract address

    Returns Promise<string>

    the EVM style address of the g contract

  • Get receipts from a transaction

    Returns Promise<EventLogs>

    an EventLogs object

  • Get the gMRX contract address

    Returns Promise<string>

    the EVM style address of the gMRX contract

  • Get the block number of cooldown for a specific address

    Parameters

    • locker: string

      the EVM style address of the locker

    Returns Promise<bigint>

    the block number which cooldown ends

  • Lock liquidity in the pool

    Parameters

    • amountLP: bigint

      the amount of LGP-LP to add

    • gasLimit: undefined | number = 250000

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Get the amount of LGP-LP locked by a specific address

    Parameters

    • locker: string

      the EVM style address of the locker

    Returns Promise<bigint>

    the amount of LGP-LP locked as wei

  • Get the LGP-LP contract address

    Returns Promise<string>

    the EVM style address of the LGP-LP contract

  • Get a quote for LP based on the current reserves in the pool

    Parameters

    • amountMRX: bigint

      amount of MRX to add as satoshi

    • amountGMRX: bigint

      amount of gMRX to add as satoshi

    Returns Promise<bigint>

    the amount of LGP-LP to receive as wei

  • Get a redemption quote based on the current reserves in the pool

    Parameters

    • amountLP: bigint

      amount of LGP-LP to add as wei

    Returns Promise<[amountMRX: bigint, amountGMRX: bigint]>

    the amount of MRX and gMRX received as satoshi

  • Get the wMRX contract address

    Returns Promise<string>

    the EVM style address of the wMRX contract

  • Remove liquidity for the underlying wMRX/MRX and gMRX

    Parameters

    • amountLP: bigint

      amount of LP to remove

    • unwrapMRX: boolean = false

      unwrap the wMRX to MRX

    • gasLimit: undefined | number = 250000

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Get the current reserves in the pool

    Returns Promise<[mrxReserve: bigint, gmrxReserve: bigint]>

    the reserves of the pool

  • Perform sendtocontract

    Parameters

    • method: string

      The contract method to send to

    • args: any[]

      The arguments to use

    • Optionalvalue: string

      The amount to send to the contract

    • OptionalgasLimit: number

      The amount of gas units allowed

    • OptionalgasPrice: number

      The satoshi price per gas

    Returns Promise<{
        hash160: string;
        sender: string;
        txid: string;
    }>

    see Result

  • Swap between gMRX and wMRX

    Parameters

    • amount: bigint

      the amount of tokens to input as satoshi

    • from: string

      the input token

    • to: string

      the output token

    • minimum: bigint

      the minimum amount of tokens to receive as satoshi

    • slippage: bigint

      the allowed amount of slippage as basis points

    • unwrapMRX: boolean

      unwrap the wMRX to MRX

    • gasLimit: undefined | number = ...

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Get a swap quote based on the current reserves in the pool

    Parameters

    • from: string

      token to input

    • to: string

      token to output

    • amountIn: bigint

      input amount of tokens

    Returns Promise<[amountOut: bigint, slippage: bigint]>

    the price quote in satoshi and the slippage as basis points

  • Swap MRX for gMRX, sending MRX and automatically wrapping it

    Parameters

    • minimum: bigint

      the minimum amount of gMRX tokens to receive as satoshi

    • slippage: bigint

      the allowed amount of slippage as basis points

    • amountMRX: undefined | string = '0'

      amount of MRX to send with the transaction

    • gasLimit: undefined | number = 250000

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Get the total amount of LGP-LP locked in the pool

    Returns Promise<bigint>

    the amount of LGP-LP locked as wei

  • Check if a specific trader has swap fee waiver

    Parameters

    • trader: string

      the EVM style address of the trader to check

    Returns Promise<boolean>

    if the trader a discount

  • Unlock liquidity in the pool

    Parameters

    • amountLP: bigint

      the amount of LGP-LP to remove

    • gasLimit: undefined | number = 250000

      the optional limit for gas units that can be consumed

    Returns Promise<Transaction>

    an array of TransactionReceipt objects