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.
| Returns | Type |
|---|
seriesId | uint256 |
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.
| Parameter | Type |
|---|
packs | uint256 |
to | address |
| Returns | Type |
|---|
sharesLocked | uint256 |
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.
| Parameter | Type |
|---|
packs | uint256 |
to | address |
| Returns | Type |
|---|
sharesReturned | uint256 |
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.
| Parameter | Type |
|---|
seriesId | uint256 |
amount | uint256 |
to | address |
redeemFix
function redeemFix(
uint256 seriesId,
uint256 amount,
address to
) external returns (uint256 shares);
Pays FV for Fix of a settled series. No time limit.
| Parameter | Type |
|---|
seriesId | uint256 |
amount | uint256 |
to | address |
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.
| Parameter | Type |
|---|
fix | uint256 |
yield | uint256 |
| Returns | Type |
|---|
usdg | uint256 |
asset | uint256 |
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.
| Parameter | Type |
|---|
seriesId | uint256 |
usdg | uint256 |
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.
currentSeries
function currentSeries() external view returns (uint256 seriesId);
| Returns | Type |
|---|
seriesId | uint256 |
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.
| Parameter | Type |
|---|
from | address |
to | address |
seriesInfo
function seriesInfo(uint256 seriesId) external view returns (Series memory);
| Parameter | Type |
|---|
seriesId | uint256 |
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.
| Parameter | Type |
|---|
seriesId | uint256 |
| Returns | Type |
|---|
packValue | uint256 |
fixValue | uint256 |
yieldValue | uint256 |
previewSplit
function previewSplit(
uint256 packs
) external view returns (uint256 sharesLocked);
| Parameter | Type |
|---|
packs | uint256 |
| Returns | Type |
|---|
sharesLocked | uint256 |
previewMerge
function previewMerge(
uint256 packs
) external view returns (uint256 sharesReturned);
| Parameter | Type |
|---|
packs | uint256 |
| Returns | Type |
|---|
sharesReturned | uint256 |
Events
SeriesOpened
event SeriesOpened(
uint256 indexed seriesId,
address indexed fix,
address indexed yield,
uint64 maturity,
uint256 sharePrice,
int256 fundingIndex,
uint256 sharesPerPack,
uint256 feeRate
);
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
fix (indexed) | address |
yield (indexed) | address |
maturity | uint64 |
sharePrice | uint256 |
fundingIndex | int256 |
sharesPerPack | uint256 |
feeRate | uint256 |
Split
event Split(
uint256 indexed seriesId,
address indexed from,
address indexed to,
uint256 packs,
uint256 sharesLocked
);
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
from (indexed) | address |
to (indexed) | address |
packs | uint256 |
sharesLocked | uint256 |
Merged
event Merged(
uint256 indexed seriesId,
address indexed from,
address indexed to,
uint256 packs,
uint256 sharesReturned
);
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
from (indexed) | address |
to (indexed) | address |
packs | uint256 |
sharesReturned | uint256 |
SeriesSettled
event SeriesSettled(
uint256 indexed seriesId,
uint256 sharePrice,
int256 fundingIndex,
uint256 packs,
uint256 packValue,
uint256 yieldValue,
uint256 yieldUsdg,
uint256 sharesBurned,
uint256 fixShares
);
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
sharePrice | uint256 |
fundingIndex | int256 |
packs | uint256 |
packValue | uint256 |
yieldValue | uint256 |
yieldUsdg | uint256 |
sharesBurned | uint256 |
fixShares | uint256 |
SeriesFunded
event SeriesFunded(uint256 indexed seriesId, uint256 usdg, uint256 totalFunded);
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
usdg | uint256 |
totalFunded | uint256 |
YieldRedeemed
event YieldRedeemed(
uint256 indexed seriesId,
address indexed owner,
address indexed to,
uint256 amount,
uint256 usdg
);
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
owner (indexed) | address |
to (indexed) | address |
amount | uint256 |
usdg | uint256 |
FixRedeemed
event FixRedeemed(
uint256 indexed seriesId,
address indexed owner,
address indexed to,
uint256 amount,
uint256 shares
);
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
owner (indexed) | address |
to (indexed) | address |
amount | uint256 |
shares | uint256 |
SeriesWoundDown
event SeriesWoundDown(
uint256 indexed seriesId,
uint256 packs,
uint256 yieldLimit
);
yieldLimit is what Yield gets first from one pack, USD with 18 decimals.
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
packs | uint256 |
yieldLimit | uint256 |
WindDownRedeemed
event WindDownRedeemed(
uint256 indexed seriesId,
address indexed owner,
uint256 fix,
uint256 yield,
uint256 usdg,
uint256 asset
);
| Parameter | Type |
|---|
seriesId (indexed) | uint256 |
owner (indexed) | address |
fix | uint256 |
yield | uint256 |
usdg | uint256 |
asset | uint256 |
Errors
NoSeries
There is no open series.
SeriesActive
The last series is not settled and fully paid.
ResetMissing
The position was not reset for a new series.
SharesWorthless
One share is worth nothing, so there is no size for a pack.
SeriesMatured
The series is past its end, so it cannot be split.
SeriesNotMatured
error SeriesNotMatured(uint64 maturity);
The series has not ended.
| Parameter | Type |
|---|
maturity | uint64 |
AlreadySettled
The series is already settled.
NotSettled
The series is not settled.
YieldNotFunded
error YieldNotFunded(uint256 missing);
The USDG for Yield has not all arrived.
| Parameter | Type |
|---|
missing | uint256 |
StatusForbids
error StatusForbids(Status status);
The status does not allow this.
ReportNotFresh
error ReportNotFresh(uint64 lastHour);
The last hourly report is not of the current hour.
| Parameter | Type |
|---|
lastHour | uint64 |
PositionMoving
A command or a round is open.
LighterStopped
Lighter stopped for good.
ZeroAmount
Nothing was asked.
BadSeriesLength
error BadSeriesLength(uint256 length);
A series cannot have this length on this chain.
| Parameter | Type |
|---|
length | uint256 |
NotVault
Only the vault can call this.