0xShikhar
Projects

AstraFi

A yield vault where solvers compete in an open auction for the right to run the strategy.

ShippedWebsite

30 Contracts

  • 30 smart contracts deployed and verified on BSC Testnet
  • 254 comprehensive unit and fuzz tests passing with 100% success
  • Built-in ProfitLock (6hr linear vesting) and CircuitBreaker to prevent flash-loan exploits

# What it is

AstraFi is an institutional yield execution protocol on BNB Chain. It eliminates reliance on centralized keeper networks by introducing a commit-reveal solver auction, an immutable 4-state Risk FSM driven by multi-oracle consensus, and ERC-1155 Exit Receipts that restore instant liquidity during delayed strategy exits.

# Why it exists

Traditional DeFi vaults suffer from opaque execution by off-chain keepers, delayed multi-sig emergency actions, and trapped exit liquidity during async protocol unwinding.

# How it works

An ERC-4626 vault core (apUSDT shares) delegates capital across five strategy rails — AsterDEX anchor (≥51%), StableSwap LP, capped delta-neutral perps (≤15%), TWAP-guarded peg arbitrage, and an optional CDP loop (≤5%) — coordinated by an on-chain ExecutionMarket commit-reveal auction, a deterministic 4-state RiskStateMachine driven by Chainlink + Pyth consensus, and CircuitBreaker/Insurance backstops funded by a 1% profit premium. Any allocation that violates concentration invariants reverts: the cycle cannot execute.

# Decisions worth explaining

  1. 01

    On-chain commit-reveal solver auctions instead of off-chain keepers

    Keeper networks are opaque and centralizing; an ExecutionMarket with staking and slashing makes execution competitive, auditable, and resistant to front-running.

  2. 02

    ERC-1155 Exit Receipts for asynchronous withdrawals

    Delayed strategy exits trapped user liquidity; making pending withdrawals tradeable claims restores optionality without forcing early unwinds.

  3. 03

    ProfitLock: 6-hour linear vesting on harvested yield

    Instantly realized harvests are sandwichable; linear unlock dampens MEV extraction around profit events.

  4. 04

    Hard revert on allocation-invariant violation

    Strategy overconcentration (>15% delta-neutral, <51% anchor rail, >20% single-cycle movement) is enforced in AllocationMath itself — a violating rebalance can never be committed.

# Details

  • ERC-4626 Vault with apUSDT share accounting
  • On-chain commit-reveal solver auction (ExecutionMarket) with staking and slashing
  • Deterministic 4-state RiskStateMachine driven by Chainlink and Pyth multi-oracle consensus
  • ERC-1155 ExitReceiptMarket allowing users to trade or redeem pending withdrawals

# Built with

Solidity · Foundry · Hardhat · BNB Chain · ERC-4626 · ERC-1155

# further reading

The essay behind AstraFi →