Pool#

PoolSwap#

class defichain.transactions.defitx.PoolSwap(addressFrom: str, tokenFrom: int | str, amountFrom: int, addressTo: str, tokenTo: int | str, maxPrice: int)#

Builds the defi transaction: PoolSwap

Parameters:
  • addressFrom – (required) the address where the tokens are located

  • tokenFrom – (required) the token that should be exchanged

  • amountFrom – (required) the amount that should be exchanged

  • addressTo – (required) the address where the exchanged tokens are sent to

  • tokenTo – (required) the token to change into

  • maxPrice – (required) maximum acceptable price

CompositeSwap#

class defichain.transactions.defitx.CompositeSwap(addressFrom: str, tokenFrom: int | str, amountFrom: int, addressTo: str, tokenTo: int | str, maxPrice: int, pools: [<class 'str'>])#

Builds the defi transaction: CompositeSwap

Parameters:
  • addressFrom (str) – (required) the address where the tokens are located

  • tokenFrom (str | int) – (required) the token that should be exchanged

  • amountFrom (float | int) – (required) the amount that should be exchanged

  • addressTo (str) – (required) the address where the exchanged tokens are sent to

  • tokenTo (str | int) – (required) the token to change into

  • maxPrice (float | int) – (required) maximum acceptable price

  • pools ([str]) – (required) specification of all pools through which the swap should take place

AddPoolLiquidity#

class defichain.transactions.defitx.AddPoolLiquidity(addressAmount: {}, shareAddress: str)#

Builds the defi transaction: AssPoolLiquidity

Parameters:
  • addressAmount (AddressAmount) – (required) address as key, quantity and token as value: AddressAmount

  • shareAddress (str) – (required) address on which the pool token should be stored

RemovePoolLiquidity#

class defichain.transactions.defitx.RemovePoolLiquidity(addressFrom: str, amount: str)#

Builds the defi transaction: RemovePoolLiquidity

Parameters:
  • addressFrom (str) – (required) the address to remove the pool tokens from

  • amount (str) – (required) value and liquidity tokens which should be removed: Amount