Skip to main content

Bob

Git Source

Namespace for the structs and enums used in the Sablier Bob protocol.

Structs

Vault

Struct encapsulating all the configuration and state of a vault.

The fields are arranged for gas optimization via tight variable packing.

struct Vault {
// slot 0
IERC20 token;
uint40 expiry;
uint40 lastSyncedAt;
// slot 1
IBobVaultShare shareToken;
// slot 2
AggregatorV3Interface oracle;
// slot 3
ISablierBobAdapter adapter;
bool isStakedInAdapter;
// slot 4
uint128 targetPrice;
uint128 lastSyncedPrice;
}

Properties

NameTypeDescription
tokenIERC20The ERC-20 token accepted for deposits in this vault.
expiryuint40The Unix timestamp when the vault expires.
lastSyncedAtuint40The Unix timestamp when the oracle price was last synced.
shareTokenIBobVaultShareThe address of ERC-20 token representing shares in this vault.
oracleAggregatorV3InterfaceThe address of the price oracle for the deposit token, provided by the vault creator.
adapterISablierBobAdapterThe adapter set for this vault, can be used to take action on the deposit token.
isStakedInAdapterboolWhether the deposit token is staked with the adapter or not.
targetPriceuint128The target price at which the vault settles, denoted in 8 decimals where 1e8 is $1.
lastSyncedPriceuint128The most recent price fetched from the oracle, denoted in 8 decimals where 1e8 is $1.

Enums

Status

Enum representing the different statuses of a vault.

Notes:

  • value0: ACTIVE Vault is open for deposits.

  • value1: EXPIRED Vault has end time less than or equal to current timestamp.

  • value2: SETTLED Vault has target price less than or equal to last synced price.

enum Status {
ACTIVE,
EXPIRED,
SETTLED
}