orderly.vault

Documentation for eth_defi.orderly.vault Python module.

Orderly deposit vault handling

Functions

deposit(vault, *, amount, token, ...[, token_id])

Deposit tokens into the Orderly vault.

withdraw(vault, *, amount, token, ...[, ...])

Withdraw tokens from the Orderly vault.

Classes

OrderlyVault

Orderly deposit vault instance.

class OrderlyVault

Bases: object

Orderly deposit vault instance.

Orderly handles deposits as “vaults” that can be used to deposit and withdraw tokens. Vautls also have “settle” functionality to reflect the balances back onchain.

__init__(web3, address)
Parameters
  • web3 (web3.main.Web3) –

  • address (str) –

deposit(vault, *, amount, token, depositor_address, orderly_account_id, broker_id, token_id=None)

Deposit tokens into the Orderly vault.

See also: https://orderly.network/docs/build-on-omnichain/user-flows/withdrawal-deposit

Parameters
  • vault (eth_defi.orderly.vault.OrderlyVault) – The vault to deposit into.

  • amount (int) – The amount of tokens to deposit.

  • token (web3.contract.contract.Contract) – The token to deposit.

  • depositor_address (eth_typing.evm.HexAddress) – The address that will be used to deposit.

  • orderly_account_id (eth_typing.evm.HexAddress) – The orderly account ID to deposit to.

  • broker_id (str) – The broker ID to deposit to.

  • token_id (str | None) – The token ID to deposit to.

Return type

tuple[web3.contract.contract.ContractFunction, web3.contract.contract.ContractFunction, web3.contract.contract.ContractFunction]

withdraw(vault, *, amount, token, wallet_address, orderly_account_id, broker_id, token_id=None)

Withdraw tokens from the Orderly vault.

See also: https://orderly.network/docs/build-on-omnichain/user-flows/withdrawal-deposit

Parameters
Return type

tuple[web3.contract.contract.ContractFunction, web3.contract.contract.ContractFunction, web3.contract.contract.ContractFunction]