Under the engine.
A technical overview of the $SCANRADAR vault architecture: share-based accounting, whitelisted strategies, keeper-controlled capital movement, performance fees and on-chain events.
deposit()
Payable. Mints shares for attached NEAR, net of first-deposit storage.
withdraw(shares)
Burns shares and pays NEAR from idle liquidity. Withdrawals remain available while paused, subject to idle liquidity.
deploy / recall
Moves capital between idle liquidity and an approved strategy, subject to its allocation cap.
harvest()
Reports strategy yield. In the prototype, the reported reward amount must be attached.
rebalance()
Recalls excess allocations and deploys idle assets toward strategy targets.
Strategy controls
Add, update or remove whitelisted strategies, configure the performance fee and manage keeper/fee-recipient roles.
// $SCANRADAR vault interface #[payable] deposit() withdraw(shares) deploy(strategy_id, amount) recall(strategy_id, amount) #[payable] harvest(strategy_id, reward_amount) rebalance() get_share_price() get_strategies() preview_deposit(amount) preview_withdraw(shares)
Shares and withdrawals use proportional asset/share accounting with rounded-down calculations and 256-bit intermediates.
A virtual share/asset offset, minimum net deposit and internal idle-asset accounting help protect the share-price model.
Up to 20 strategies can be configured. Enabled strategy targets may total no more than 10,000 basis points.
The amount not assigned to enabled strategy targets remains idle as the vault's withdrawal buffer.
Harvested rewards compound into strategy balances. The performance fee is capped at 2,000 basis points and is minted as shares.
Pausing blocks deposits, deployments and rebalances. Withdrawals, recalls and harvest operations remain available.
Withdrawals are paid from idle liquidity. If it is insufficient, the withdrawal fails without permanently burning the user's shares.
State-changing vault calls emit structured events so activity can be tracked and inspected.
Event standard
Events use the protocol event standard with version 1.0.0.
Movement history
deposit, withdraw, withdraw_refunded, deploy, recall, harvest and rebalance.
EVENT_JSON:{
"standard":"scanradar",
"version":"1.0.0",
"event":"harvest",
"data":[{
"strategy_id":0,
"reward":"…",
"fee_assets":"…",
"fee_shares":"…",
"share_price":"…"
}]
}Rust + near-sdk
The reference implementation uses Rust 1.86.0 and near-sdk 5.27. Newer compiler output may require runtime compatibility checks.
Local verification
Build the WASM contract and run the Rust test suite before deploying or integrating with a live application.
cargo install cargo-near
cargo near build non-reproducible-wasm
cargo test
# Example read-only configuration call
near contract call-function as-read-only \
SCANRADAR_CONTRACT \
get_config \
json-args '{}' network-config mainnet now$SCANRADAR
Track the engine. Understand the rules. Explore the protocol.