Skip to main content

GedhoSeries

Splits FV into Fix and Yield, joins them again and settles the series. One series at a time. It has no Admin functions.

Inherits Upgradeable base.

Anyone​

openSeries​

function openSeries() external returns (uint256 seriesId);

Opens the next series at the price of one share now. Anyone can call it.

ReturnsType
seriesIduint256

split​

function split(
uint256 packs,
address to
) external returns (uint256 sharesLocked);

Locks FV and mints the same number of Fix and Yield.

Reads no report and no price. Not stopped by a hold or by Admin, only by a pause.

ParameterType
packsuint256
toaddress
ReturnsType
sharesLockeduint256

merge​

function merge(
uint256 packs,
address to
) external returns (uint256 sharesReturned);

Burns Fix and Yield and returns FV.

Reads no report and no price. Only a pause stops it before settlement. In a wind-down it works for pairs that were not redeemed.

ParameterType
packsuint256
toaddress
ReturnsType
sharesReturneduint256

settle​

function settle() external;

Settles the series at the first valid report at or after its end. Anyone can call it, except during a pause: then only the guardian or Admin.

redeemYield​

function redeemYield(
uint256 seriesId,
uint256 amount,
address to
) external returns (uint256 usdg);

Pays USDG for Yield of a settled series. No time limit.

ParameterType
seriesIduint256
amountuint256
toaddress
ReturnsType
usdguint256

redeemFix​

function redeemFix(
uint256 seriesId,
uint256 amount,
address to
) external returns (uint256 shares);

Pays FV for Fix of a settled series. No time limit.

ParameterType
seriesIduint256
amountuint256
toaddress
ReturnsType
sharesuint256

windDownRedeem​

function windDownRedeem(
uint256 fix,
uint256 yield
) external returns (uint256 usdg, uint256 asset);

Burns Fix and Yield of a series that was open at the wind-down. Pays Yield first within the money of the packs, and Fix from the rest. Later arrivals are paid by calling it again with zero.

ParameterType
fixuint256
yielduint256
ReturnsType
usdguint256
assetuint256

Deployer​

initialize​

function initialize() external;

Marks the proxy as initialized, once. The series contract has nothing else to set.

The vault​

fundSeries​

function fundSeries(uint256 seriesId, uint256 usdg) external;

Counts USDG that arrived for a settled series.

Vault only.

ParameterType
seriesIduint256
usdguint256

beginWindDown​

function beginWindDown() external;

Fixes the claim of Yield when the vault winds down.

Vault only.

Read​

seriesLength​

function seriesLength() external view returns (uint64);

Seconds from the last reported hour to the end of a series that opens now. It never changes.

ReturnsType
-uint64

currentSeries​

function currentSeries() external view returns (uint256 seriesId);
ReturnsType
seriesIduint256

transferAllowed​

function transferAllowed(address from, address to) external view returns (bool);

Whether Fix and Yield may move from from to to now. Fix and Yield ask it on every transfer, so its name and form never change. False during a pause, unless one side is zero, the vault, the queue or this contract.

ParameterType
fromaddress
toaddress
ReturnsType
-bool

seriesInfo​

function seriesInfo(uint256 seriesId) external view returns (Series memory);
ParameterType
seriesIduint256
ReturnsType
-Series

packValues​

function packValues(
uint256 seriesId
) external view returns (uint256 packValue, uint256 fixValue, uint256 yieldValue);

Value of one pack, one Fix and one Yield now, USD with 18 decimals.

fixValue + yieldValue = packValue. After the settlement Yield is worth its USDG, Fix is worth its FV at the price now, and the pack is worth both.

ParameterType
seriesIduint256
ReturnsType
packValueuint256
fixValueuint256
yieldValueuint256

previewSplit​

function previewSplit(
uint256 packs
) external view returns (uint256 sharesLocked);
ParameterType
packsuint256
ReturnsType
sharesLockeduint256

previewMerge​

function previewMerge(
uint256 packs
) external view returns (uint256 sharesReturned);
ParameterType
packsuint256
ReturnsType
sharesReturneduint256

Events​

SeriesOpened​

event SeriesOpened(
uint256 indexed seriesId,
address indexed fix,
address indexed yield,
uint64 maturity,
uint256 sharePrice,
int256 fundingIndex,
uint256 sharesPerPack,
uint256 feeRate
);
ParameterType
seriesId (indexed)uint256
fix (indexed)address
yield (indexed)address
maturityuint64
sharePriceuint256
fundingIndexint256
sharesPerPackuint256
feeRateuint256

Split​

event Split(
uint256 indexed seriesId,
address indexed from,
address indexed to,
uint256 packs,
uint256 sharesLocked
);
ParameterType
seriesId (indexed)uint256
from (indexed)address
to (indexed)address
packsuint256
sharesLockeduint256

Merged​

event Merged(
uint256 indexed seriesId,
address indexed from,
address indexed to,
uint256 packs,
uint256 sharesReturned
);
ParameterType
seriesId (indexed)uint256
from (indexed)address
to (indexed)address
packsuint256
sharesReturneduint256

SeriesSettled​

event SeriesSettled(
uint256 indexed seriesId,
uint256 sharePrice,
int256 fundingIndex,
uint256 packs,
uint256 packValue,
uint256 yieldValue,
uint256 yieldUsdg,
uint256 sharesBurned,
uint256 fixShares
);
ParameterType
seriesId (indexed)uint256
sharePriceuint256
fundingIndexint256
packsuint256
packValueuint256
yieldValueuint256
yieldUsdguint256
sharesBurneduint256
fixSharesuint256

SeriesFunded​

event SeriesFunded(uint256 indexed seriesId, uint256 usdg, uint256 totalFunded);
ParameterType
seriesId (indexed)uint256
usdguint256
totalFundeduint256

YieldRedeemed​

event YieldRedeemed(
uint256 indexed seriesId,
address indexed owner,
address indexed to,
uint256 amount,
uint256 usdg
);
ParameterType
seriesId (indexed)uint256
owner (indexed)address
to (indexed)address
amountuint256
usdguint256

FixRedeemed​

event FixRedeemed(
uint256 indexed seriesId,
address indexed owner,
address indexed to,
uint256 amount,
uint256 shares
);
ParameterType
seriesId (indexed)uint256
owner (indexed)address
to (indexed)address
amountuint256
sharesuint256

SeriesWoundDown​

event SeriesWoundDown(
uint256 indexed seriesId,
uint256 packs,
uint256 yieldLimit
);

yieldLimit is what Yield gets first from one pack, USD with 18 decimals.

ParameterType
seriesId (indexed)uint256
packsuint256
yieldLimituint256

WindDownRedeemed​

event WindDownRedeemed(
uint256 indexed seriesId,
address indexed owner,
uint256 fix,
uint256 yield,
uint256 usdg,
uint256 asset
);
ParameterType
seriesId (indexed)uint256
owner (indexed)address
fixuint256
yielduint256
usdguint256
assetuint256

Errors​

NoSeries​

error NoSeries();

There is no open series.

SeriesActive​

error SeriesActive();

The last series is not settled and fully paid.

ResetMissing​

error ResetMissing();

The position was not reset for a new series.

SharesWorthless​

error SharesWorthless();

One share is worth nothing, so there is no size for a pack.

SeriesMatured​

error SeriesMatured();

The series is past its end, so it cannot be split.

SeriesNotMatured​

error SeriesNotMatured(uint64 maturity);

The series has not ended.

ParameterType
maturityuint64

AlreadySettled​

error AlreadySettled();

The series is already settled.

NotSettled​

error NotSettled();

The series is not settled.

YieldNotFunded​

error YieldNotFunded(uint256 missing);

The USDG for Yield has not all arrived.

ParameterType
missinguint256

StatusForbids​

error StatusForbids(Status status);

The status does not allow this.

ParameterType
statusStatus

ReportNotFresh​

error ReportNotFresh(uint64 lastHour);

The last hourly report is not of the current hour.

ParameterType
lastHouruint64

PositionMoving​

error PositionMoving();

A command or a round is open.

LighterStopped​

error LighterStopped();

Lighter stopped for good.

ZeroAmount​

error ZeroAmount();

Nothing was asked.

BadSeriesLength​

error BadSeriesLength(uint256 length);

A series cannot have this length on this chain.

ParameterType
lengthuint256

NotVault​

error NotVault();

Only the vault can call this.