Crate levana_perpswap_cosmos
source ·Expand description
Messages and helper data types for the perps protocol.
Modules
- Backwards compatibility helpers
- Constants used within perps events.
- Messages for each contract which is a part of perps.
- Address Helpers
- Different representations of the direction of a position.
- Error handling helpers for within the perps protocol
- Helpers for parsing event data into well typed event data types.
- Ibc helpers
- Data types to represent leverage
- Feature-gated logging functionality
- Data types for representing the assets covered by a market.
- Max gains of a position in terms of the quote asset.
- This is a centralized location for cw_storage Item storage keys and Map namespaces
- Number type and helpers Provides a number of data types, methods, and traits to have more fine-grained and strongly-typed control of numeric data.
- Exports very commonly used items into the prelude glob
- Data types and conversion functions for different price representations.
- Contract result helpers
- Types for market kill switch and winddown.
- Helpers for dealing with CosmWasm storage.
- Types to represent timestamps and durations.
- Represents the native coin or CW20 used for collateral in a market.
Macros
- Makes it easy to create a Response where all the values are attributes, like a HashMap.
- This version only logs if the given flag is in DEBUG_LOG_FLAGS (will not log if log_print feature is disabled, in that case it’s a no-op)
- This version will always log (except if log_print feature is not enabled, it’s a no-op)
- Generate a PerpError and then wrap it up in an anyhow error
- Like perp_anyhow but accepts optional extra data
- Return early with the given perp error
- Like perp_bail but takes extra optional data
- Ensure a condition is true, otherwise returns from the function with an error.
- Generate a PerpError value
- Generate a PerpError value with additional optional data