Closed NibiruHeisenberg closed 1 year ago
We should make this a parameter of the virtual pool rather than the module. It's common for different asset pairs to have different maintenance margin requirements and maximum leverage on larger exchanges. Different position change magnitudes can also factor into this.
Pair | Tier | Max Leverage |
---|---|---|
BTC/USDT | 1 | 10x |
BTC/DAI | 1 | 3x |
AAVE/BTC | 1 | 5x |
BNB/USDT | 1 | 10x |
DOT/BUSD | 1 | 5x |
ATOM/ETH | 1 | 3x |
ATOM/BUSD | 1 | 5x |
References:
Asset | Leverage Limit |
---|---|
BTC | 20x |
ETH | 20x |
All Other Markets | 10x |
Reference: Maximum Leverage for Perpetuals. dYdX
"Huobi Futures support 1x-100x leverage"
Reference: Contract Leverage Introduction
@NibiruChain/backend
It's already a parameter for the vpool (#729)
x/vpool/keeper/pool_state.go
// CreatePool creates a pool for a specific pair.
func (k Keeper) CreatePool(
ctx sdk.Context,
pair common.AssetPair,
tradeLimitRatio sdk.Dec, // integer with 6 decimals, 1_000_000 means 1.0
quoteAssetReserve sdk.Dec,
baseAssetReserve sdk.Dec,
fluctuationLimitRatio sdk.Dec,
maxOracleSpreadRatio sdk.Dec,
maintenanceMarginRatio sdk.Dec,
maxLeverage sdk.Dec,
) {
k.Pools.Insert(ctx, pair, types.VPool{
Pair: pair,
BaseAssetReserve: baseAssetReserve,
QuoteAssetReserve: quoteAssetReserve,
TradeLimitRatio: tradeLimitRatio,
FluctuationLimitRatio: fluctuationLimitRatio,
MaxOracleSpreadRatio: maxOracleSpreadRatio,
MaintenanceMarginRatio: maintenanceMarginRatio,
MaxLeverage: maxLeverage,
})
k.ReserveSnapshots.Insert(
ctx,
collections.Join(pair, ctx.BlockTime()),
types.NewReserveSnapshot(
pair,
baseAssetReserve,
quoteAssetReserve,
ctx.BlockTime(),
),
)
}
Ideally all parameters of a vpool (along with the k value) should be adjustable by governance.
I'm wondering if we want to have k slowly adjusting from A->B on a timeframe? Curve does it for their amplification parameter on their stable pools, osmosis does it for their weight change in LBP.
The objective of this ticket would be to move the vpool fields into the module params so that they are subject to governance proposals. Right now I don't believe there is a way to modify the vpool fields after the chain goes live.
Task Summary
Vpool
, it can be removed from the genesis.