Skip to content

Commit 1e4af87

Browse files
committed
chore: regen core docs
1 parent 37db549 commit 1e4af87

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1075
-968
lines changed

.gitbook/developers/modules/core/README.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

.gitbook/developers/modules/core/genutils.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitbook/developers/modules/injective/auction/02_messages.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
sidebar_position: 2
3-
title: Messages
3+
title: Messages
44
---
55

66
# Messages
77

8-
In this section, we describe the processing of the auction messages and the corresponding updates to the state.
8+
In this section we describe the processing of the auction messages and the corresponding updates to the state.
99

1010
## Msg/Bid
1111

@@ -26,7 +26,7 @@ message MsgBid {
2626

2727
This service message is expected to fail if:
2828

29-
* `Round` does not equal the current auction round
30-
* `BidAmount` does not exceed the previous highest bid amount by at least `min_next_increment_rate` percent.
29+
- `Round` does not equal the current auction round
30+
- `BidAmount` does not exceed the previous highest bid amount by at least `min_next_increment_rate` percent.
3131

3232
This service message transfers the `BidAmount` of INJ from the `Sender` to the auction module, stores the bid, and refunds the last bidder's bid amount.
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22
sidebar_position: 3
3-
title: End-Block
3+
title: End-Block
44
---
55

6-
# EndBlock
6+
# End-Block
77

88
### Auction Settlement
99

10-
The settlement of a given auction round occurs when `blockTime ≥ EndingTimeStamp.` If a non-zero INJ bid was placed during this period (i.e., there exists a `LastBid`), the following procedure will take place:
10+
The settlement of a given auction round occurs when `blockTime ≥ EndingTimeStamp.` If a non-zero INJ bid was placed during this period (i.e. there exists a `LastBid`), the following procedure will take place:
1111

12-
* The winning INJ bid amount is burned.
13-
* The basket of coins held by the auction module is transferred to the winning bidder.
14-
* `LastAuctionResult` is written to state and `EventAuctionResult` is emitted.
15-
* The `LastBid` is cleared.
16-
* The AuctionRound is incremented by 1 and the EndingTimestamp is incremented by `AuctionPeriod`.
17-
* The accumulated exchange fees are transferred from the `exchange` module to the `auction` module for the new upcoming auction.
12+
- The winning INJ bid amount is burned.
13+
- The basket of coins held by the auction module is transferred to the winning bidder.
14+
- `LastAuctionResult` is written to state and `EventAuctionResult` is emitted.
15+
- The `LastBid` is cleared.
16+
- The AuctionRound is incremented by 1 and the EndingTimestamp is incremented by `AuctionPeriod`.
17+
- The accumulated exchange fees are transferred from the `exchange` module to the `auction` module for the new upcoming auction.
1818

19-
If the round closed without any successful bids, the existing coin basket will be rolled over into the next auction and combined with the new accumulated fee basket.
19+
If the round closed without any successful bids, the existing coin basket will be rolled over into the next auction and combined with the new accumulated fee basket.
2020

21-
![img.png](img.png)
21+
![img.png](./img.png)
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# Auction
1+
# `Auction`
22

33
## Abstract
44

5-
The `auction` module periodically obtains a basket of tokens accumulated from trading fees from the `exchange` module and auctions the basket to the highest bidder in an open English auction for INJ. The winner of this auction receives the basket of tokens, and the winning INJ bid amount from this auction is burned.
5+
The `auction` module periodically obtains a basket of tokens accumulated from trading fees from the `exchange` module and auctions the basket to the highest bidder in an open English auction for INJ. The winner of this auction receives the basket of tokens and the winning INJ bid amount from this auction is burned.
66

77
## Contents
88

9-
1. [**State**](01_state.md)
10-
2. [**Messages**](02_messages.md)
11-
3. [**End Block**](03_end_block.md)
12-
4. [**Events**](04_events.md)
13-
5. [**Params**](05_params.md)
9+
1. **[State](./01_state.md)**
10+
2. **[Messages](./02_messages.md)**
11+
3. **[End Block](./03_end_block.md)**
12+
4. **[Events](./04_events.md)**
13+
5. **[Params](./05_params.md)**
14+
15+

.gitbook/developers/modules/injective/exchange/00_derivative_market_concepts.md

Lines changed: 122 additions & 88 deletions
Large diffs are not rendered by default.

.gitbook/developers/modules/injective/exchange/01_spot_market_concepts.md

Lines changed: 53 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,68 +3,79 @@ sidebar_position: 2
33
title: Spot Market Concepts
44
---
55

6-
# Spot Markets Concepts
6+
# Spot Market Concepts
77

88
## Definitions
99

1010
In a Spot Market with ticker **AAA/BBB, AAA is the base asset, BBB is the quote asset.**
1111

1212
For example, in the ETH/USDT market
1313

14-
* ETH is base asset
15-
* USDT is the quote asset
14+
- ETH is base asset
15+
- USDT is the quote asset
1616

17-
The spot market's **price** refers to how much USDT (the quote asset) is required for one unit of ETH (the base asset). For all spot markets, **fees are always paid in the quote asset**, e.g., USDT.
17+
The spot market's **price** refers to how much USDT (the quote asset) is required for one unit of ETH (the base
18+
asset). For all spot markets, **fees are always paid in the quote asset**, e.g., USDT.
1819

19-
**Debit vs. Credit**
20+
**Debit vs Credit**
2021

21-
* **Debit Amount** refers to the amount of asset that is withdrawn from an account.
22-
* **Credit Amount** refers to the amount of asset that is deposited to an account.
22+
- **Debit Amount** refers to the amount of asset that is withdrawn from an account.
23+
- **Credit Amount** refers to the amount of asset that is deposited to an account.
2324

2425
**Refunds**
2526

26-
In our system, a refund refers to the action of incrementing the **available balance** of an account. This liberation of funds occurs as the result of an encumbrance being lifted from the account (e.g. cancelling a limit order, reducing an order's payable fee to a maker fee, using less margin to fund a market order, etc.).
27+
In our system, a refund refers to the action of incrementing the **available balance** of an account. This liberation of
28+
funds occurs as the result of an encumbrance being lifted from the account (e.g. cancelling a limit order, reducing an
29+
order's payable fee to a maker fee, using less margin to fund a market order, etc.).
2730

2831
### Limit Buy Order
2932

30-
A limit buy order seeks to buy a specified `Quantity` ETH (**base asset**) in exchange for `Quantity * Price` amount of USDT (**quote asset**) **plus fees,** which depend on whether the limit order becomes executed as a maker order or a taker order.
33+
A limit buy order seeks to buy a specified `Quantity` ETH (**base asset**) in exchange for `Quantity * Price` amount of
34+
USDT (**quote asset**) **plus fees** which depend on whether the limit order becomes executed as a maker order or a
35+
taker order.
3136

3237
### Limit Sell Order
3338

34-
A limit sell order seeks to sell a specified `Quantity` ETH (**base asset**) in exchange for `Quantity * Price` amount of USDT (**quote asset**) **minus fees,** which depend on whether the limit order becomes executed as a maker order or a taker order.
39+
A limit sell order seeks to sell a specified `Quantity` ETH (**base asset**) in exchange for `Quantity * Price` amount
40+
of USDT (**quote asset**) **minus fees** which depend on whether the limit order becomes executed as a maker order or a
41+
taker order.
3542

3643
### Market Buy Order
3744

38-
A market buy order seeks to buy a specified `Quantity` ETH (**base asset**) at a specified worst price which is at or near the current ask using the respective account quote asset balance (USDT) as collateral\*\* (inclusive of fees).
45+
A market buy order seeks to buy a specified `Quantity` ETH (**base asset**) at a specified worst price which is at or near
46+
the current ask using the respective account quote asset balance (USDT) as collateral\*\* (inclusive of fees).
3947

40-
As a result, each market buy order implicitly has a maximum acceptable price associated with it, as filling the market order beyond that price would simply fail due to a lack of funds.
48+
As a result, each market buy order implicitly has a maximum acceptable price associated with it, as filling the market
49+
order beyond that price would simply fail due to a lack of funds.
4150

4251
### Market Sell Order
4352

44-
A market sell order seeks to sell a specified `Quantity` ETH (**base asset**) at a specified worst price which is at or near the current bid in exchange for any amount of the quote asset (USDT) available in the market.
53+
A market sell order seeks to sell a specified `Quantity` ETH (**base asset**) at a specified worst price which is at or
54+
near the current bid in exchange for any amount of the quote asset (USDT) available in the market.
4555

4656
As a result, each market sell order implicitly has a zero price associated with it.
4757

4858
### Order Types
4959

50-
* BUY (1): A standard buy order to purchase an asset at either the current market price or a set limit price.
51-
* SELL (2): A standard sell order to sell an asset at either the current market price or a set limit price.
52-
* STOP_BUY (3): This order type is not supported for spot markets.
53-
* STOP_SELL (4): This order type is not supported for spot markets.
54-
* TAKE_BUY (5): This order type is not supported for spot markets.
55-
* TAKE_SELL (6): This order type is not supported for spot markets.
56-
* BUY_PO (7): Post-Only Buy. This order type ensures that the order will only be added to the order book and not match with a pre-existing order. It guarantees that you will be the market "maker" and not the "taker".
57-
* SELL_PO (8): Post-Only Sell. Similar to BUY_PO, this ensures that your sell order will only add liquidity to the order book and not match with a pre-existing order.
58-
* BUY_ATOMIC (9): An atomic buy order is a market order that gets executed instantly, bypassing the Frequent Batch Auctions (FBA). It's intended for smart contracts that need to execute a trade instantly. A higher fee is paid, defined in the global exchange parameters.
59-
* SELL_ATOMIC (10): An atomic sell order is similar to a BUY_ATOMIC, and it gets executed instantly at the current market price, bypassing the FBA.
60+
- BUY (1): A standard buy order to purchase an asset at either the current market price or a set limit price.
61+
- SELL (2): A standard sell order to sell an asset at either the current market price or a set limit price.
62+
- STOP_BUY (3): This order type is not supported for spot markets.
63+
- STOP_SELL (4): This order type is not supported for spot markets.
64+
- TAKE_BUY (5): This order type is not supported for spot markets.
65+
- TAKE_SELL (6): This order type is not supported for spot markets.
66+
- BUY_PO (7): Post-Only Buy. This order type ensures that the order will only be added to the order book and not match with a pre-existing order. It guarantees that you will be the market "maker" and not the "taker".
67+
- SELL_PO (8): Post-Only Sell. Similar to BUY_PO, this ensures that your sell order will only add liquidity to the order book and not match with a pre-existing order.
68+
- BUY_ATOMIC (9): An atomic buy order is a market order that gets executed instantly, bypassing the Frequent Batch Auctions (FBA). It's intended for smart contracts that need to execute a trade instantly. A higher fee is paid defined in the global exchange parameters.
69+
- SELL_ATOMIC (10): An atomic sell order is similar to a BUY_ATOMIC, and it gets executed instantly at the current market price, bypassing the FBA.
6070

6171
### Market Data Requirements
6272

63-
Orderbook data aside, so long as our Chain supports the **base capability** to obtain Tick by Tick trading data, aggregations can be applied to obtain most of the necessary higher order data, including
73+
Orderbook data aside, so long as our Chain supports the **base capability** to obtain Tick by Tick trading data,
74+
aggregations can be applied to obtain most of the necessary higher order data, including
6475

65-
* OHLCV data
66-
* Account Trading History
67-
* Market Statistics
76+
- OHLCV data
77+
- Account Trading History
78+
- Market Statistics
6879

6980
## Spot Market Lifecycle
7081

@@ -74,9 +85,10 @@ A market is first created either by the instant launch functionality through `Ms
7485

7586
### Listing Fee based Spot Market Creation
7687

77-
Allow anyone to create an active spot market of their choice without requiring governance approval by burning a pre-set SpotMarketInstantListingFee of INJ.
88+
Allow anyone to create an active spot market of their choice without requiring governance approval by burning a pre-set
89+
SpotMarketInstantListingFee of INJ.
7890

79-
We should still check that the denom is valid, though.
91+
We should still check that the denom is valid though.
8092

8193
### Spot Market Status Update
8294

@@ -89,15 +101,17 @@ A Spot Market can exist in four different states:
89101

90102
#### **Active State**
91103

92-
If a spot market is in an active state, it can accept orders and trades.
104+
If a spot market is an active state, it can accept orders and trades.
93105

94106
#### Paused State
95107

96-
If a spot market is in a paused state, it will no longer accept orders and trades and will also not allow any users to take actions on that market (no order cancellations).
108+
If a spot market is a paused state, it will no longer accept orders and trades and will also not allow any users to take
109+
actions on that market (no order cancellations).
97110

98111
#### Suspended State
99112

100-
If a spot market is in a suspended state, it will no longer accept orders and trades, and will only allow traders to cancel their orders.
113+
If a spot market is a suspended state, it will no longer accept orders and trades, and will only allow traders to cancel
114+
their orders.
101115

102116
## Demolished State
103117

@@ -107,15 +121,15 @@ When a market becomes demolished, all outstanding orders are cancelled.
107121

108122
There are three state transitions that correspond to the following status changes
109123

110-
* Activate Action - **Paused or Suspended Status → Active Status**
111-
* Pause Action - **Active or Suspended Status → Paused Status**
112-
* Suspend Action - **Active or Paused Status → Suspended Status**
113-
* Demolish Action - **Paused or Suspended Status → Demolished Status**
124+
- Activate Action - **Paused or Suspended Status → Active Status**
125+
- Pause Action - **Active or Suspended Status → Paused Status**
126+
- Suspend Action - **Active or Paused Status → Suspended Status**
127+
- Demolish Action - **Paused or Suspended Status → Demolished Status**
114128

115129
### Spot Market Parameter Update
116130

117131
The following parameters exist for Spot Markets
118132

119-
* SpotMarketInstantListingFee
120-
* DefaultSpotMakerFeeRate
121-
* DefaultSpotTakerFeeRate
133+
- SpotMarketInstantListingFee
134+
- DefaultSpotMakerFeeRate
135+
- DefaultSpotTakerFeeRate

0 commit comments

Comments
 (0)