Developer Info

Source Codearrow-up-right

The Y2K Markets operate in the Arbitrum Ethereum Network environment.

INTERACTIVE ARCHITECTURE DIAGRAM

V2's architecture bears resemblance to V1, incorporating similar components such as Vault Factoryarrow-up-right, Vaultsarrow-up-right, and Controllerarrow-up-right. However, V2 also includes substantial enhancements in the form of new Carouselarrow-up-right and CarouselFactoryarrow-up-right functionalities.

VaultV2

In contrast to V1, VaultV2arrow-up-right is a SemiFungibleVaultarrow-up-right token based on the ERC1155 standard. The position Id or epochId is now a hash composed of (marketId, epochBegin, epochEnd), which can be deterministically computed using the getEpochIdarrow-up-right function on the VaultFactoryV2arrow-up-right contract.

Deposit

Shares continue to be minted 1 to 1, but in V2, the depositAsset can be any ERC20 token as defined by the VaultFactoryV2arrow-up-right.

Withdraw

Unlike in V1, the withdraw fee in V2 is deducted when the vault is settled. The user's entitlement is then calculated based on the percentage of shares they had in the Vault before the insurance epoch began.

Carouselarrow-up-right inherits the VaultV2arrow-up-right contract and introduces new functionalities: Rollovers, Queue Deposits, and Linear Information Tax.

Rollovers:

Users can opt to rollover existing positions into the next available epoch using the enlistInRolloverarrow-up-right function, specifying the epochId, shares, and receiver. To cease rollovers, users can invoke the delistInRolloverarrow-up-right function. Pending rollovers can be minted by anyone calling the mintRolloversarrow-up-right function during an active deposit window.

Queue Deposits:

V2 permits users to deposit at any time using the deposit function with an id of 0. A QueueItem is minted and later redeemed for a position in the next epoch deposit window. Any party can call the mintDepositInQueuearrow-up-right function during an active deposit window to redeem all stored QueueItems.

VaultFactoryV2

The marketId and epochId can be calculated using the getMarketIdarrow-up-right and getEpochIdarrow-up-right functions, respectively.

CarouselFactory

CarouselFactoryarrow-up-right is an extension of the VaultV2Factory contract. It differs in the creation of markets and configuration of epochs which are handled through createNewCarouselMarketarrow-up-right and createEpochWithEmissionsarrow-up-right respectively.

A significant improvement is that y2k emissions can now be configured and distributed within each epoch, eliminating the need for deploying an extra StakingRewardsarrow-up-right contract.

Last updated