Module 0xdee9::clob_v2
- Struct
PoolCreated
- Struct
OrderPlaced
- Struct
OrderCanceled
- Struct
AllOrdersCanceledComponent
- Struct
AllOrdersCanceled
- Struct
OrderFilled
- Struct
DepositAsset
- Struct
WithdrawAsset
- Struct
MatchedOrderMetadata
- Struct
Order
- Struct
TickLevel
- Resource
Pool
- Resource
PoolOwnerCap
- Constants
- Function
usr_open_orders_exist
- Function
usr_open_orders_for_address
- Function
usr_open_orders
- Function
withdraw_fees
- Function
delete_pool_owner_cap
- Function
destroy_empty_level
- Function
create_account
- Function
create_pool_
- Function
create_pool
- Function
create_customized_pool
- Function
create_pool_with_return_
- Function
create_pool_with_return
- Function
create_customized_pool_with_return
- Function
create_customized_pool_v2
- Function
deposit_base
- Function
deposit_quote
- Function
withdraw_base
- Function
withdraw_quote
- Function
swap_exact_base_for_quote
- Function
swap_exact_base_for_quote_with_metadata
- Function
swap_exact_quote_for_base
- Function
swap_exact_quote_for_base_with_metadata
- Function
match_bid_with_quote_quantity
- Function
match_bid
- Function
match_ask
- Function
place_market_order
- Function
place_market_order_with_metadata
- Function
place_market_order_int
- Function
inject_limit_order
- Function
place_limit_order
- Function
place_limit_order_with_metadata
- Function
place_limit_order_int
- Function
order_is_bid
- Function
emit_order_canceled
- Function
emit_order_filled
- Function
cancel_order
- Function
remove_order
- Function
cancel_all_orders
- Function
batch_cancel_order
- Function
clean_up_expired_orders
- Function
list_open_orders
- Function
account_balance
- Function
get_market_price
- Function
get_level2_book_status_bid_side
- Function
get_level2_book_status_ask_side
- Function
get_level2_book_status
- Function
get_order_status
- Function
matched_order_metadata
- Function
matched_order_metadata_info
- Function
asks
- Function
bids
- Function
tick_size
- Function
maker_rebate_rate
- Function
taker_fee_rate
- Function
pool_size
- Function
open_orders
- Function
order_id
- Function
tick_level
- Function
original_quantity
- Function
quantity
- Function
is_bid
- Function
owner
- Function
expire_timestamp
- Function
quote_asset_trading_fees_value
- Function
clone_order
use 0x1::option;
use 0x1::type_name;
use 0x1::vector;
use 0x2::balance;
use 0x2::clock;
use 0x2::coin;
use 0x2::event;
use 0x2::linked_table;
use 0x2::object;
use 0x2::sui;
use 0x2::table;
use 0x2::transfer;
use 0x2::tx_context;
use 0xdee9::critbit;
use 0xdee9::custodian_v2;
use 0xdee9::math;
Struct PoolCreated
Emitted when a new pool is created
struct PoolCreated has copy, drop, store
Fields
- pool_id: object::ID
- object ID of the newly created pool
- base_asset: type_name::TypeName
- quote_asset: type_name::TypeName
- taker_fee_rate: u64
- maker_rebate_rate: u64
- tick_size: u64
- lot_size: u64
Struct OrderPlaced
Emitted when a maker order is injected into the order book.
struct OrderPlaced<BaseAsset, QuoteAsset> has copy, drop, store
Fields
- pool_id: object::ID
- object ID of the pool the order was placed on
- order_id: u64
- ID of the order within the pool
- client_order_id: u64
- ID of the order defined by client
- is_bid: bool
- owner: address
- owner ID of the AccountCap that placed the order
- original_quantity: u64
- base_asset_quantity_placed: u64
- price: u64
- expire_timestamp: u64
Struct OrderCanceled
Emitted when a maker order is canceled.
struct OrderCanceled<BaseAsset, QuoteAsset> has copy, drop, store
Fields
- pool_id: object::ID
- object ID of the pool the order was placed on
- order_id: u64
- ID of the order within the pool
- client_order_id: u64
- ID of the order defined by client
- is_bid: bool
- owner: address
- owner ID of the AccountCap that canceled the order
- original_quantity: u64
- base_asset_quantity_canceled: u64
- price: u64
Struct AllOrdersCanceledComponent
A struct to make all orders canceled a more effifient struct
struct AllOrdersCanceledComponent<BaseAsset, QuoteAsset> has copy, drop, store
Fields
Struct AllOrdersCanceled
Emitted when batch of orders are canceled.
struct AllOrdersCanceled<BaseAsset, QuoteAsset> has copy, drop, store
Fields
- pool_id: object::ID
- object ID of the pool the order was placed on
- orders_canceled: vector<clob_v2::AllOrdersCanceledComponent<BaseAsset, QuoteAsset>>
Struct OrderFilled
Emitted only when a maker order is filled.
struct OrderFilled<BaseAsset, QuoteAsset> has copy, drop, store
Fields
- pool_id: object::ID
- object ID of the pool the order was placed on
- order_id: u64
- ID of the order within the pool
- taker_client_order_id: u64
- ID of the order defined by taker client
- maker_client_order_id: u64
- ID of the order defined by maker client
- is_bid: bool
- taker_address: address
- owner ID of the AccountCap that filled the order
- maker_address: address
- owner ID of the AccountCap that placed the order
- original_quantity: u64
- base_asset_quantity_filled: u64
- base_asset_quantity_remaining: u64
- price: u64
- taker_commission: u64
- maker_rebates: u64
Struct DepositAsset
Emitted when user deposit asset to custodian
struct DepositAsset<Asset> has copy, drop, store
Fields
- pool_id: object::ID
- object id of the pool that asset deposit to
- quantity: u64
- quantity of the asset deposited
- owner: address
- owner address of the AccountCap that deposit the asset
Struct WithdrawAsset
Emitted when user withdraw asset from custodian
struct WithdrawAsset<Asset> has copy, drop, store
Fields
- pool_id: object::ID
- object id of the pool that asset withdraw from
- quantity: u64
- quantity of the asset user withdrew
- owner: address
- owner ID of the AccountCap that withdrew the asset
Struct MatchedOrderMetadata
Returned as metadata only when a maker order is filled from place order functions.
struct MatchedOrderMetadata<BaseAsset, QuoteAsset> has copy, drop, store
Fields
- pool_id: object::ID
- object ID of the pool the order was placed on
- order_id: u64
- ID of the order within the pool
- is_bid: bool
- Direction of order.
- taker_address: address
- owner ID of the AccountCap that filled the order
- maker_address: address
- owner ID of the AccountCap that placed the order
- base_asset_quantity_filled: u64
- qty of base asset filled.
- price: u64
- price at which basset asset filled.
- taker_commission: u64
- maker_rebates: u64
Struct Order
struct Order has drop, store
Fields
Struct TickLevel
struct TickLevel has store
Fields
- price: u64
- open_orders: linked_table::LinkedTable<u64, clob_v2::Order>