Skip to content

fix(doc): vague verification description on MakerFeeRate and TakerFeeRate#32

Open
chen4903 wants to merge 1 commit into
InjectiveFoundation:release/v1.18.xfrom
chen4903:doc-maker-taker-fee-validation
Open

fix(doc): vague verification description on MakerFeeRate and TakerFeeRate#32
chen4903 wants to merge 1 commit into
InjectiveFoundation:release/v1.18.xfrom
chen4903:doc-maker-taker-fee-validation

Conversation

@chen4903

@chen4903 chen4903 commented Apr 1, 2026

Copy link
Copy Markdown

Principal

In general, we encourage the maker as he provides the liquidity, and "discourage" the taker as he takes away the liquidity. So the fee of maker should be less than taker.

Not clear description

But in spec ,the description is not clear: it should be False❌ in this context

// https://github.com/InjectiveFoundation/injective-core/blob/release/v1.18.x/injective-chain/modules/exchange/spec/04_state_transitions.md?plain=1#L408
- Validate `MakerFeeRate` is bigger than `TakerFeeRate`

In the code, it is:

// https://github.com/InjectiveFoundation/injective-core/blob/release/v1.18.x/injective-chain/modules/exchange/types/v2/proposal.go#L445-L449
	if p.MakerFeeRate != nil && p.TakerFeeRate != nil {
		if p.MakerFeeRate.GT(*p.TakerFeeRate) {
			return types.ErrFeeRatesRelation
		}
	}

Other description

Let's look at another description: it should be True✅ in this context

// https://github.com/InjectiveFoundation/injective-core/blob/release/v1.18.x/injective-chain/modules/exchange/spec/04_state_transitions.md?plain=1#L409
- Validate `InitialMarginRatio` is bigger than `MaintenanceMarginRatio`.

In the code, it is:

https://github.com/InjectiveFoundation/injective-core/blob/release/v1.18.x/injective-chain/modules/exchange/types/v2/msgs.go#L705-L707
	if msg.InitialMarginRatio.LTE(msg.MaintenanceMarginRatio) {
		return types.ErrMarginsRelation
	}

Summary

In the spec, similar descriptions like "Validate xxx is xxx than xxx" are used, but their semantics are not unified; sometimes they require True, and sometimes False. This makes it confusing for readers to understand the spec. Therefore, I modified it to make it clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant