initializeOtc
Parameters
updateOtcConfig
Parameters
addOtcCollateralBalance
Parameters
sellGnsForCollateral
_amountCollateral of _collateralIndex
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
function initializeOtc(struct IOtc.OtcConfig _config) external
| Name | Type | Description |
|---|---|---|
| _config | IOtc.OtcConfig | new OTC Config |
function updateOtcConfig(struct IOtc.OtcConfig _config) external
| Name | Type | Description |
|---|---|---|
| _config | IOtc.OtcConfig | new OTC Config. Sum of treasuryShareP, stakingShareP, burnShareP must equal 100 and premiumP must be less than or equal to MAX_PREMIUM_P |
function addOtcCollateralBalance(uint8 _collateralIndex, uint256 _collateralAmount) external
| Name | Type | Description |
|---|---|---|
| _collateralIndex | uint8 | collateral index |
| _collateralAmount | uint256 | amount of collateral to increase (collateral precision) |
function sellGnsForCollateral(uint8 _collateralIndex, uint256 _collateralAmount) external
_amountCollateral of _collateralIndex
| Name | Type | Description |
|---|---|---|
| _collateralIndex | uint8 | collateral index |
| _collateralAmount | uint256 | amount of collateral to trade (collateral precision) |
function getOtcConfig() external view returns (struct IOtc.OtcConfig)
function getOtcBalance(uint8 _collateralIndex) external view returns (uint256)
| Name | Type | Description |
|---|---|---|
| _collateralIndex | uint8 | collateral index |
function getOtcRate(uint8 _collateralIndex) external view returns (uint256)
| Name | Type | Description |
|---|---|---|
| _collateralIndex | uint8 | collateral index |
event OtcConfigUpdated(struct IOtc.OtcConfig config)
| Name | Type | Description |
|---|---|---|
| config | struct IOtc.OtcConfig | new OTC config |
event OtcBalanceUpdated(uint8 collateralIndex, uint256 balanceCollateral)
| Name | Type | Description |
|---|---|---|
| collateralIndex | uint8 | collateral index |
| balanceCollateral | uint256 | new balance (collateral precision) |
event OtcExecuted(uint8 collateralIndex, uint256 collateralAmount, uint256 gnsPriceCollateral, uint256 treasuryAmountGns, uint256 stakingAmountGns, uint256 burnAmountGns)
| Name | Type | Description |
|---|---|---|
| collateralIndex | uint8 | collateral index |
| collateralAmount | uint256 | amount of collateral traded (collateral precision) |
| gnsPriceCollateral | uint256 | effective gns/collateral price, including premium (1e10) |
| treasuryAmountGns | uint256 | amount of GNS sent to treasury (1e18) |
| stakingAmountGns | uint256 | amount of GNS sent to GNS Staking (1e18) |
| burnAmountGns | uint256 | amount of GNS burned (1e18) |
error InvalidShareSum()
