๐Ÿ“šCommon Types

The following are common data types used across White Whale's contracts. There might be few more that are used internally, though this list contains the types that are exposed via the entry points.



Represents an asset

  • info: AssetInfo - asset information

  • amount: Uint128 - asset amount


Represents a contract, either a Pool or Vault

  • address: String - contract address

  • contract_type: ContractType - type of the contract, vault or pool


Represents a Factory for either Collecting or Querying fees for

  • factory_addr: String - factory address

  • factory_type: FactoryType - the type of factory, either pool or vault


Feature toggle for the pair/pool contract

  • withdrawals_enabled: bool - toggle for withdrawals

  • deposits_enabled: bool - toggle for deposits

  • swaps_enabled: bool - toggle for swaps


Represents a fee

  • share: Decimal - fee share


Represents an incentive flow

  • flow_id: u64 - A unique identifier of the flow.

  • flow_label: Option<String> - An alternative flow label.

  • flow_creator: Addr - The account which opened the flow and can manage it.

  • flow_asset: Asset - The asset the flow was created to distribute.

  • claimed_amount: Uint128 - The amount of the flow_asset that has been claimed so far.

  • curve: Curve - The type of curve the flow has.

  • start_epoch: u64 - The epoch at which the flow starts.

  • end_epoch: u64 - The epoch at which the flow ends.

  • emitted_tokens: HashMap<u64, Uint128> - Map containing emitted tokens.

  • asset_history: BTreeMap<u64, (Uint128, u64)> - Map containing the amount of tokens it was expanded to at a given epoch.


Provides an incentive contract information

  • incentive_address: Addr - The address of the incentive contract

  • lp_reference: Vec<u8> - A byte-array reference to the LP address


Defines information about a pair/pool

  • asset_infos: [AssetInfo; 2] - asset infos within the pool

  • contract_addr: String - pool address

  • liquidity_token: String - LP token address

  • asset_decimals: [u8; 2] - decimals for the assets in the pool


Fees used by the pool

  • protocol_fee: Fee - protocol fees

  • swap_fee: Fee - swap fees

  • burn_fee: Fee - burn fees


Parameters to update the vault configuration with

  • flash_loan_enabled: Option<bool> - if users should be allowed to perform flash-loans

  • deposit_enabled: Option<bool> - if users should be able to deposit funds to the contract

  • withdraw_enabled: Option<bool> - if users should be able to withdraw funds from the contract

  • new_owner: Option<String> - the new owner of the contract

  • new_vault_fees: Option<VaultFee> - the new fees used for the vault

  • new_fee_collector_addr: Option<String> - the new address of the fee collector


Fees used by the vault

  • protocol_fee: Fee - protocol fees

  • flash_loan_fee: Fee - flash loan fees

  • burn_fee: Fee - burn fees


Response for the vaults query

  • vault: String - vault address

  • asset_info_reference: Vec<u8> - Asset info reference



Represents asset information

  • Token { contract_addr: String } - used for cw20 tokens

  • NativeToken { denom: String } - used for native or IBC tokens


Callback messages for the vault

  • AfterTrade { old_balance: Uint128, loan_balance: Uint128 } - used for making sure the flash loan is paid back after all operations were executed


Represents what to collect fees from

  • Contracts { contracts: Vec<Contract> } - collects the fees accumulated by the given contracts

  • Factory { factory_addr: String, factory_type: FactoryType } - collects the fees accumulated by the contracts the given factory created


Represents the type of factory

  • Vault { start_after: Option<Vec<u8>>, limit: Option<u32> } - vault factory option, supports pagination

  • Pool { start_after: Option<[AssetInfo; 2]>, limit: Option<u32> } - pool factory option, supports pagination


A flow identifier

  • Id(u64) - flow id

  • Label(String) - flow label


Represents what to query fees from

  • Contracts { contracts: Vec<Contract> } - specifies list of Contracts to query fees for

  • Factory { factory_addr: String, factory_type: FactoryType } - defines a factory for which to query fees from its children


A swap operation, used by the pool router

  • TerraSwap { offer_asset_info: AssetInfo, ask_asset_info: AssetInfo } - terraswap type of operation

Last updated