Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nimross committed May 26, 2023
1 parent 55d842e commit f7ba139
Show file tree
Hide file tree
Showing 27 changed files with 246 additions and 246 deletions.
2 changes: 1 addition & 1 deletion client/docs/swagger-ui/swagger-ui-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -18396,7 +18396,7 @@
plusdu: "⨥",
pluse: "⩲",
PlusMinus: "±",
plusmn: "±",
plusbxn: "±",
plussim: "⨦",
plustwo: "⨧",
pm: "±",
Expand Down
2 changes: 1 addition & 1 deletion docs/.yarn/releases/yarn-1.22.18.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -60226,7 +60226,7 @@ return /******/ (function(modules) { // webpackBootstrap
reg: '\u00AE',
macr: '\u00AF',
deg: '\u00B0',
plusmn: '\u00B1',
plusbxn: '\u00B1',
sup2: '\u00B2',
sup3: '\u00B3',
acute: '\u00B4',
Expand Down
4 changes: 2 additions & 2 deletions docs/basics/tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Learn about the different types of native tokens/coins available in Blackfury. {
The two native coin types of Blackfury are **Black** and **Fury**:

- **Black**: Stablecoins that track the price of fiat currencies, and they are named for their fiat counterparts. In the
early stage of the mainnet launch, it will mainly issue **BlackUSD**, or **USM**, which tracks/pegs the price of $USD.
early stage of the mainnet launch, it will mainly issue **BlackUSD**, or **USBX**, which tracks/pegs the price of $USD.
- **Fury**: Native staking coin that partially absorbs the price volatility of Black. Users stake Fury to validators to
add blocks of transactions to the blockchain, and earn various fees and rewards. Holders of Fury also can vote on
proposals and participate in on-chain governance. And Fury is also used for gas consumption for running smart
Expand All @@ -27,7 +27,7 @@ with Ethereum.
And the base denomination of Black is `uusd`.

```
1 BlackUSD = 1 USM = 1 * 1e6 uusd
1 BlackUSD = 1 USBX = 1 * 1e6 uusd
```

## Other Cosmos Coins
Expand Down
4 changes: 2 additions & 2 deletions docs/intro/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ assets settlement center and experimental DeFi innovation zone.

Here’s a glance at some key features of Blackfury:

- System native stablecoin **BlackUSD**, or **USM**
- System native stablecoin **BlackUSD**, or **USBX**
- Pegging through partial backing/collateral and partial algorithmic
- ve(3,3) time-locked of native **Fury** and proportional incentive
- Web3 and EVM compatibility
Expand All @@ -38,7 +38,7 @@ Here’s a glance at some key features of Blackfury:
The blackfury system consists of two main native coins, Black and Fury.

- **Black**: Stablecoins that track the price of fiat currencies, and they are named for their fiat counterparts. In the
early stage of the mainnet launch, it will mainly issue **BlackUSD**, or **USM**, which tracks/pegs the price of $USD.
early stage of the mainnet launch, it will mainly issue **BlackUSD**, or **USBX**, which tracks/pegs the price of $USD.
- **Fury**: Blackfury blockchain's native staking coin that partially absorbs the price volatility of Black. Users stake
Fury to validators to add blocks of transactions to the blockchain, and earn various fees and rewards. Holders of Fury
also can vote on proposals and participate in on-chain governance.
Expand Down
54 changes: 27 additions & 27 deletions docs/intro/stablecoin.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ external human strategies.
For this reason, we have avoided becoming a pure algorithmic stablecoin. We have seen firsthand that the highly
respected and massively huge [Terra](https://terra.money) still cannot escape the spiral of collapse caused by targeted
sniping during extreme market conditions. The two kinds of minting/burning mechanisms for Blackfury stablecoin (called Black
USD or USM) are as follows.
USD or USBX) are as follows.

### Fractional-Backing-Algorithmic (FBA)

Expand All @@ -61,25 +61,25 @@ algorithmic supply. We define the ratio of backing value to algorithmic value is

What we need to highlight here is the algorithmic part. As mentioned above, pure algorithmic stablecoins are extremely
risky. However, as a native token that captures the value of the network, it makes sense for FURY to participate in the
USM minting process, but the participation extent needs to be regulated by the system based on the current demand for
USM. Especially at the beginning of the network, we recommend setting the BR to 95%, which means that only $0.05 worth
of FURYs are allowed to be minted for 1 $USM. Formula follows:
USBX minting process, but the participation extent needs to be regulated by the system based on the current demand for
USBX. Especially at the beginning of the network, we recommend setting the BR to 95%, which means that only $0.05 worth
of FURYs are allowed to be minted for 1 $USBX. Formula follows:

```
For 0 < BR <= 1,
BackingValue = MintUSM * BR
FURYValue = MintUSM * (1 - BR)
BackingValue = MintUSBX * BR
FURYValue = MintUSBX * (1 - BR)
```

When the market demand for USM rises, the system automatically decreases the BR value, allowing more FURYs to be burned
in the minting of USMs. When the market demand for USMs falls, the system automatically increases the BR value, allowing
fewer FURYs to be burned in the minting of USMs. In turn, USMs can be burned to swap for the reserved backing assets and
When the market demand for USBX rises, the system automatically decreases the BR value, allowing more FURYs to be burned
in the minting of USBXs. When the market demand for USBXs falls, the system automatically increases the BR value, allowing
fewer FURYs to be burned in the minting of USBXs. In turn, USBXs can be burned to swap for the reserved backing assets and
minted FURYs, again in a proportion controlled by the BR value.

This dynamic adaptive capability to changes in market demand absorbs the possible volatility of USM into the composition
This dynamic adaptive capability to changes in market demand absorbs the possible volatility of USBX into the composition
of the reserving asset portfolio of the system pool. Any small disturbance is absorbed very quickly, avoiding the
accumulation of large fluctuations with consequences that the system cannot resist. We believe that the system's
worst-case response mechanism is the cornerstone of maintaining USM pegging.
worst-case response mechanism is the cornerstone of maintaining USBX pegging.

![fractional-backing-algorithmic](../images/fba.png)

Expand All @@ -89,25 +89,25 @@ Overcollateralization is the most reliable and tried-and-true method of minting
is [DAI](https://makerdao.com). Over-collateralized assets can be volatile assets such as ETH and BTC, or other
stablecoin assets like USDC.

Overcollateralization means that the amount of the maximum mintable USMs must be less than the value of the
Overcollateralization means that the amount of the maximum mintable USBXs must be less than the value of the
collateralized asset, and the ratio between them is called **LTV (Loan-To-Value)**. For example, if the LTV is 67% and
the collateral value is $100, then a maximum of 67 $USM can be minted. We also define the **Over-Collateralized Rate (OCR)**, which is equal to the reciprocal of the LTV; i.e., if the LTV is 67%, then the OCR is 150%.
the collateral value is $100, then a maximum of 67 $USBX can be minted. We also define the **Over-Collateralized Rate (OCR)**, which is equal to the reciprocal of the LTV; i.e., if the LTV is 67%, then the OCR is 150%.

We have made a slight change to the overcollateralization method by also defining **Basic LTV**, which is generally less
than LTV, i.e., the user can only mint USM at the Basic LTV ratio of the collateral value in the most basic case; if the
than LTV, i.e., the user can only mint USBX at the Basic LTV ratio of the collateral value in the most basic case; if the
user wants to achieve the maximum LTV ratio, it must burn a certain amount of FURY, which we call the ratio of the
maximum burned FURY value to the minted USM value as **CLR (Catalytic Fury Ratio)**. Taking the previous example, with
an LTV of 67%, a Basic LTV of 45%, and a CLR of 2%, a user can mint a maximum of 45 $USM when the collateral value is
$100; if the user tries to mint 67 $USM, he needs to burn $67 * 2% = $1.34 worth of FURYs; if he tries to mint 55 $USM,
maximum burned FURY value to the minted USBX value as **CLR (Catalytic Fury Ratio)**. Taking the previous example, with
an LTV of 67%, a Basic LTV of 45%, and a CLR of 2%, a user can mint a maximum of 45 $USBX when the collateral value is
$100; if the user tries to mint 67 $USBX, he needs to burn $67 * 2% = $1.34 worth of FURYs; if he tries to mint 55 $USBX,
he needs to burn $55 * 2% * ( 55% - 45%) / (67% - 45%) = $0.5 value of FURY, where the CLR involved in the calculation
is adjusted by the position of the actual LTV in a linear scale between the Basic LTV and the maximum LTV. The formula
is:

```
MaxUSM = CollateralValue * LTV
BasicUSM = CollateralValue * BasicLTV
For MintUSM, and BasicUSM < MintUSM < MaxUSM,
BurnedFURYValue = MintUSM * CLR * (MintUSM / CollateralValue - BasicLTV) / (LTV - BasicLTV)
MaxUSBX = CollateralValue * LTV
BasicUSBX = CollateralValue * BasicLTV
For MintUSBX, and BasicUSBX < MintUSBX < MaxUSBX,
BurnedFURYValue = MintUSBX * CLR * (MintUSBX / CollateralValue - BasicLTV) / (LTV - BasicLTV)
```

![over-collateralized-catalytic](../images/occ.png)
Expand All @@ -117,13 +117,13 @@ BurnedFURYValue = MintUSM * CLR * (MintUSM / CollateralValue - BasicLTV) / (LTV
Blackfury has a built-in price oracle module that periodically accepts near real-time quotes from active staking
validators, and first removes outliers with large deviations, and then takes the median as the final true and fair
on-chain price. Since the Blackfury stablecoin is anchored in $USD, the oracle quotes will also be denominated in $USD,
which is actually `$1 * 1e-6` given the need for some precision. The tokens to be quoted are first FURY and USM, and
which is actually `$1 * 1e-6` given the need for some precision. The tokens to be quoted are first FURY and USBX, and
then all the asset tokens used to back or collateralize the stablecoin (e.g. ETH) will also need to be quoted. Blackfury
encourages staking validators to take diversified market price sources that help the oracle's final quotes faithfully
reflect real market prices.

The price data from the oracle will be directly applied to the exchange rate calculations during the minting and burning
of USM, which is critical to the operation of the entire system and the pegging stability of USM. Therefore, Blackfury
of USBX, which is critical to the operation of the entire system and the pegging stability of USBX. Therefore, Blackfury
does not rule out the possibility of introducing quotes from professional oracles with sufficient credibility, such as
Chainlink, in the future.

Expand All @@ -133,7 +133,7 @@ The supply and demand for stablecoins is invisibly regulated by the free market,
pegged fiat currencies (e.g. USD), and generally works well, with both suppliers and demanders satisfying their trading
positions well. Blackfury will have a good variety of configurable system-level parameters and will also have a range of
built-in adaptive monetary policies that are robust enough to deal with common bad cases. Blackfury will be iteratively
upgraded to incorporate more and better auto-adjustment strategies as the USM becomes more widely used.
upgraded to incorporate more and better auto-adjustment strategies as the USBX becomes more widely used.

However, just as almost all software systems cannot respond to extreme situations in a very timely manner and always
make the very right changes, we cannot fully trust that established parameter auto-adjustment strategies will always
Expand All @@ -146,9 +146,9 @@ the Blackfury stablecoin system.
## Diverse Application Scenarios with Sufficient Breadth and Depth

With the advent of the Web3 era, crypto technologies and protocols will be used in a wider and deeper variety of
scenarios, and we aim to make more people want to hold and use Blackfury stablecoins in this wave sweeping the globe. USM
scenarios, and we aim to make more people want to hold and use Blackfury stablecoins in this wave sweeping the globe. USBX
can be used as the basic exchange medium for various DeFi protocols or projects on the chain, as a circulating currency
within GameFi, and also used by NFT creators and collectors to value their NFTs. USM is inherently suited for pricing
within GameFi, and also used by NFT creators and collectors to value their NFTs. USBX is inherently suited for pricing
and payment for data sharing and rentals in new Web3 social and information applications that emphasize user ownership
of data. USM does not exclude the connection to the offline world, but we believe it would be a sign of Blackfury's
of data. USBX does not exclude the connection to the offline world, but we believe it would be a sign of Blackfury's
success to be one of the circulation currencies in the vast Web3 world of the future.
6 changes: 3 additions & 3 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2828,7 +2828,7 @@ commander@2.17.x:
commander@^2.20.0:
version "2.20.3"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USBXxE+oj+ey/lJEnhZw75x/OMcQ==

commander@~2.19.0:
version "2.19.0"
Expand Down Expand Up @@ -4243,7 +4243,7 @@ for-in@^1.0.2:
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k=
integrity sha1-C+4AUBiusbxDQo6865ljdATbsG5k=

forever-agent@~0.6.1:
version "0.6.1"
Expand Down Expand Up @@ -4474,7 +4474,7 @@ global-dirs@^2.0.1:
global@^4.3.2:
version "4.4.0"
resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406"
integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==
integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usbxGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==
dependencies:
min-document "^2.19.0"
process "^0.11.10"
Expand Down
20 changes: 10 additions & 10 deletions types/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@ const (
BaseDenom = AttoFuryDenom

AttoFuryDenom = "afury" // 1e-18
MicroUSMDenom = "uusm" // 1e-6
MicroUSBXDenom = "uusbx" // 1e-6
)

var (
// MicroUSMTarget defines the target exchange rate of uusm denominated in uUSD.
MicroUSMTarget = sdk.OneDec()
// MicroUSBXTarget defines the target exchange rate of uusbx denominated in uUSD.
MicroUSBXTarget = sdk.OneDec()
)

func SetDenomMetaDataForStableCoins(ctx sdk.Context, k bankkeeper.Keeper) {
for _, base := range []string{MicroUSMDenom} {
for _, base := range []string{MicroUSBXDenom} {
if _, ok := k.GetDenomMetaData(ctx, base); ok {
continue
}

display := base[1:] // e.g., usm
display := base[1:] // e.g., usbx
// Register meta data to bank module
k.SetDenomMetaData(ctx, banktypes.Metadata{
Description: "The native stable token of the Blackfury.",
DenomUnits: []*banktypes.DenomUnit{
{Denom: "u" + display, Exponent: uint32(0), Aliases: []string{"micro" + display}}, // e.g., uusm
{Denom: "m" + display, Exponent: uint32(3), Aliases: []string{"milli" + display}}, // e.g., musm
{Denom: display, Exponent: uint32(6), Aliases: []string{}}, // e.g., usm
{Denom: "u" + display, Exponent: uint32(0), Aliases: []string{"micro" + display}}, // e.g., uusbx
{Denom: "m" + display, Exponent: uint32(3), Aliases: []string{"milli" + display}}, // e.g., musbx
{Denom: display, Exponent: uint32(6), Aliases: []string{}}, // e.g., usbx
},
Base: base,
Display: display,
Name: strings.ToUpper(display), // e.g., USM
Symbol: strings.ToUpper(display), // e.g., USM
Name: strings.ToUpper(display), // e.g., USBX
Symbol: strings.ToUpper(display), // e.g., USBX
})
}
}
56 changes: 28 additions & 28 deletions x/bank/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,20 @@ func (suite *KeeperTestSuite) TestKeeper_DenomsMetadata() {
var (
t = suite.T()
k = suite.app.BankKeeper
denom = blacktypes.MicroUSMDenom
denom = blacktypes.MicroUSBXDenom
base = denom
display = base[1:]
uusmMeta = banktypes.Metadata{
uusbxMeta = banktypes.Metadata{
Description: "The native stable token of the Blackfury.",
DenomUnits: []*banktypes.DenomUnit{
{Denom: "u" + display, Exponent: uint32(0), Aliases: []string{"micro" + display}}, // e.g., uusm
{Denom: "m" + display, Exponent: uint32(3), Aliases: []string{"milli" + display}}, // e.g., musm
{Denom: display, Exponent: uint32(6), Aliases: []string{""}}, // e.g., usm
{Denom: "u" + display, Exponent: uint32(0), Aliases: []string{"micro" + display}}, // e.g., uusbx
{Denom: "m" + display, Exponent: uint32(3), Aliases: []string{"milli" + display}}, // e.g., musbx
{Denom: display, Exponent: uint32(6), Aliases: []string{""}}, // e.g., usbx
},
Base: base,
Display: display,
Name: strings.ToUpper(display), // e.g., USM
Symbol: strings.ToUpper(display), // e.g., USM
Name: strings.ToUpper(display), // e.g., USBX
Symbol: strings.ToUpper(display), // e.g., USBX
}
)

Expand All @@ -173,13 +173,13 @@ func (suite *KeeperTestSuite) TestKeeper_DenomsMetadata() {
require.NoError(t, err)
meta := res.Metadatas[0]
require.Equal(t, 1, len(res.Metadatas))
require.Equal(t, uusmMeta.Description, meta.Description)
require.Equal(t, uusmMeta.Base, meta.Base)
require.Equal(t, uusmMeta.Display, meta.Display)
require.Equal(t, uusmMeta.Name, meta.Name)
require.Equal(t, uusmMeta.Symbol, meta.Symbol)
require.Equal(t, uusmMeta.DenomUnits[0], meta.DenomUnits[0])
require.Equal(t, uusmMeta.DenomUnits[1], meta.DenomUnits[1])
require.Equal(t, uusbxMeta.Description, meta.Description)
require.Equal(t, uusbxMeta.Base, meta.Base)
require.Equal(t, uusbxMeta.Display, meta.Display)
require.Equal(t, uusbxMeta.Name, meta.Name)
require.Equal(t, uusbxMeta.Symbol, meta.Symbol)
require.Equal(t, uusbxMeta.DenomUnits[0], meta.DenomUnits[0])
require.Equal(t, uusbxMeta.DenomUnits[1], meta.DenomUnits[1])
require.Equal(t, uint64(1), res.Pagination.Total)
}

Expand All @@ -188,20 +188,20 @@ func (suite *KeeperTestSuite) TestKeeper_DenomMetadata() {
var (
t = suite.T()
k = suite.app.BankKeeper
denom = blacktypes.MicroUSMDenom
denom = blacktypes.MicroUSBXDenom
base = denom
display = base[1:]
uusmMeta = banktypes.Metadata{
uusbxMeta = banktypes.Metadata{
Description: "The native stable token of the Blackfury.",
DenomUnits: []*banktypes.DenomUnit{
{Denom: "u" + display, Exponent: uint32(0), Aliases: []string{"micro" + display}}, // e.g., uusm
{Denom: "m" + display, Exponent: uint32(3), Aliases: []string{"milli" + display}}, // e.g., musm
{Denom: display, Exponent: uint32(6), Aliases: []string{""}}, // e.g., usm
{Denom: "u" + display, Exponent: uint32(0), Aliases: []string{"micro" + display}}, // e.g., uusbx
{Denom: "m" + display, Exponent: uint32(3), Aliases: []string{"milli" + display}}, // e.g., musbx
{Denom: display, Exponent: uint32(6), Aliases: []string{""}}, // e.g., usbx
},
Base: base,
Display: display,
Name: strings.ToUpper(display), // e.g., USM
Symbol: strings.ToUpper(display), // e.g., USM
Name: strings.ToUpper(display), // e.g., USBX
Symbol: strings.ToUpper(display), // e.g., USBX
}
)
res, err := k.DenomMetadata(sdk.WrapSDKContext(suite.ctx), nil)
Expand All @@ -223,11 +223,11 @@ func (suite *KeeperTestSuite) TestKeeper_DenomMetadata() {
res, err = k.DenomMetadata(sdk.WrapSDKContext(suite.ctx), req)
require.NoError(t, err)
meta := res.Metadata
require.Equal(t, uusmMeta.Description, meta.Description)
require.Equal(t, uusmMeta.Base, meta.Base)
require.Equal(t, uusmMeta.Display, meta.Display)
require.Equal(t, uusmMeta.Name, meta.Name)
require.Equal(t, uusmMeta.Symbol, meta.Symbol)
require.Equal(t, uusmMeta.DenomUnits[0], meta.DenomUnits[0])
require.Equal(t, uusmMeta.DenomUnits[1], meta.DenomUnits[1])
require.Equal(t, uusbxMeta.Description, meta.Description)
require.Equal(t, uusbxMeta.Base, meta.Base)
require.Equal(t, uusbxMeta.Display, meta.Display)
require.Equal(t, uusbxMeta.Name, meta.Name)
require.Equal(t, uusbxMeta.Symbol, meta.Symbol)
require.Equal(t, uusbxMeta.DenomUnits[0], meta.DenomUnits[0])
require.Equal(t, uusbxMeta.DenomUnits[1], meta.DenomUnits[1])
}
Loading

0 comments on commit f7ba139

Please sign in to comment.