Trader Integration

Technical guide for traders integrating with RFY vault execution, settlement, and workflow requirements.


Overview

The RFY Vault is an epoch-based ERC-4626 vault that enables offchain strategy execution by a whitelisted multisig trader address, while maintaining collateral fully onchain.

Deposited assets are pooled into a vault and locked for a fixed epoch duration. During the active epoch, a whitelisted trader (market maker) is authorized to borrow capital, execute strategies offchain, and return funds at settlement with realized profit or loss.

The vault acts as:

  • Collateral custody layer

  • Accounting and NAV calculation layer

  • Settlement enforcement mechanism

circle-info

The system allows traders to access liquidity for executing strategies, with final PnL enforced onchain at settlement via a multisig.


Roles

Trader (Market Maker)

Authorized via TRADER_ROLE.

Permissions:

  • Borrow capital during an active epoch

  • Settle final PnL at expiry


Admin (RFY)

Authorized via DEFAULT_ADMIN_ROLE.

Responsibilities:

  • Start and manage epochs

  • Configure vault parameters

  • Control deposit and withdrawal states


Vault Lifecycle

1. Deposit Phase

Users deposit assets into the vault and receive ERC-4626 shares.

  • Deposits increase totalAssets

  • Shares represent proportional ownership of the vault

circle-info

Deposits remain open until an epoch is started.


2. Epoch Initialization

When an epoch starts:

  • Deposits are paused

  • Withdrawals are paused

  • Vault capital is locked

  • Initial assets are recorded

Capital Allocation:

  • Portion may be deployed to an external vault (yield layer)

  • Remaining assets stay as idle liquidity


3. Trading Phase

During the active epoch, the trader can borrow funds.

Borrowing

Behavior:

  • Funds are sourced in order:

    1. Idle vault liquidity

    2. External vault withdrawals

  • Borrowed amount is tracked internally

  • Liquidity can be requested at any time during the epoch via the trader multisig.


Available Liquidity

Returns:

  • Idle liquidity

  • Redeemable external vault assets

circle-info

Borrowing is pull-based, the vault does not push capital, the trader requests it.

triangle-exclamation

4. Settlement Phase

Settlement occurs after the epoch duration has elapsed.

triangle-exclamation

Settlement Mechanics

Requirements

  • Epoch must be finished

  • Trader must approve token transfer


Core Logic

The trader must return funds based on borrowed capital and realized PnL:

Execution:


Constraints

Losses cannot exceed borrowed capital.

circle-exclamation

Final Accounting

At settlement, the vault computes:

Final vault assets:

This updates the vault’s NAV (totalAssets).


Post-Settlement

  • Epoch is closed

  • Withdrawals are enabled

  • Deposits remain paused until reopened

Users can redeem shares based on updated NAV.

Last updated