Migaloo Docs
Search…
⌃K
📚

Common Types

The following are common data types used across Migaloo contracts. There might be few more that are used internally, though this list contains the types that are exposed via the entry points.
Struct
Description
Contains
Asset
Represents an asset
  • info: AssetInfo - asset information
  • amount: Uint128 - asset amount
Contract
Represents a contract, either a Pool or Vault
  • address: String - contract address
  • contract_type: ContractType - type of the contract, vault or pool
Factory
Represents a Factory for either Collecting or Quering fees for
  • factory_addr: String - factory address
  • factory_type: FactoryType - the type of factory, either pool or vault
FeatureToggle
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
Fee
Represents a fee
  • share: Decimal - fee share
PairInfo
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
PoolFee
Fees used by the pool
  • protocol_fee: Fee - protocol fees
  • swap_fee: Fee - swap fees
UpdateConfigParams
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
VaultFee
Fees used by the vault
  • protocol_fee: Fee - protocol fees
  • flash_loan_fee: Fee - flash loan fees
VaultInfo
Response for the vaults query
  • vault: String - vault address
  • asset_info_reference: Vec<u8> - Asset info reference
Enums
Description
Alternatives
AssetInfo
Represents asset information
  • Token { contract_addr: String } - used for cw20 tokens
  • NativeToken { denom: String } - used for native or IBC tokens
CallbackMsg
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
CollectFeesFor
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
FactoryType
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
QueryFeesFor
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
SwapOperation
A swap operation, used by the pool router
  • TerraSwap { offer_asset_info: AssetInfo, ask_asset_info: AssetInfo } - terraswap type of operation