Stablecoins Minter

The SC Minter module is the main access point to Geminon's stablecoin and index offering. It allows users to exchange GEX tokens for one of the Geminon stablecoins, and vice versa.

The minting and redemption mechanism is algorithmic. The SC Minter contract always exchanges a value (measured in US dollars) of GEX tokens for the exact same stablecoin value and vice versa. There is no slippage in the operation, only the protocol commission is discounted.

Minting protocol

In order to mint a new supply of stablecoin, it is necessary to hand over a number of GEX tokens, VGV_G. The amount of minted stablecoin, VSV_S, is given by the expression:

VS=VGPGPSV_S = V_G \dfrac {P_G} {P_S}

The price of the GEX token, PGP_G, is obtained from the protocol oracle as the average of the price in all the pools of the network.

The stablecoin price, PSP_S, is derived from the stablecoin contract being traded. All Geminon stablecoins and index coins have built-in functions in their contracts that allow obtaining their exchange value in US dollars. For more detailed information on how stablecoin prices are obtained, see the following pages:

pageStablecoinspageDeflationary currencies

Redeem

The process for redeeming stablecoin is identical to that for minting. A quantity of stablecoin, VSV_S, is given in exchange for a quantity of GEX tokens, VGV_G, which is calculated with the same expression used for minting:

VG=VSPSPGV_G = V_S \dfrac {P_S} {P_G}

Price manipulation attacks

The formulas described in the previous point for calculating the amounts of minted stablecoin depend directly on the values of the GEX token prices and the coin in question. This makes the contract vulnerable to changes in those prices. Price gouging attacks are the most common in blockchain-based decentralized finance protocols. For this reason, secure pricing sources that cannot be easily manipulated should always be used.

Geminon stablecoins are priced from the Chainlink oracle network, which is decentralized and takes data from external sources, so they are considered completely secure.

The price of the GEX token, on the other hand, depends on the state of the liquidity pools in the network, which is why it is susceptible to manipulation, especially through flash loans. The Geminon protocol incorporates security measures that prevent such price manipulations from being successful:

  • The price of the GEX token is taken indirectly through the Geminon oracle, which uses the price of the pools at the close of the previous block. This means that flash loan attacks have no effect on the price, since the operations within the current block are not incorporated into the calculation.

  • The Geminon oracle calculates the price by taking the average of all the GLP. This increases the cost for the attacker, since it is necessary to simultaneously manipulate all the pools.

  • The GLPs incorporate an algorithm that filters operations with abnormal volume for the calculation of the reference price of the pool.

  • GLPs entropy capture feature heavily penalizes trades that produce excessive price slippage, making the attack economically unfeasible.

For more detailed information on LPG security mechanisms, consult the dedicated sections:

pageInternal oraclepagePrice manipulation attacks

Internal security protocols

The SC Minter contract incorporates the same internal security mechanisms as the GLP contracts. For more detailed information, consult the previous section corresponding to GLP safety protocols.

Last updated