Skip to content

2854 - docs: add NEP-621 Tokenized Vault standard#3057

Open
matiasbenary wants to merge 4 commits into
masterfrom
docs/2854-nep-621-tokenized-vault
Open

2854 - docs: add NEP-621 Tokenized Vault standard#3057
matiasbenary wants to merge 4 commits into
masterfrom
docs/2854-nep-621-tokenized-vault

Conversation

@matiasbenary

Copy link
Copy Markdown
Contributor

Closes #2854

Comment thread primitives/vault/standard.mdx Outdated
description: "Learn how Tokenized Vaults (NEP-621) are defined on NEAR"
---

A **tokenized vault** is a smart contract that accepts deposits of an underlying [fungible token (FT)](../ft/standard) and, in exchange, issues **shares** that represent proportional ownership of the assets held by the vault.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use less bold emphasis

Comment thread primitives/vault/standard.mdx Outdated

<Tip>

NEP-621 defines the **interface** and the **expected behavior** of a vault contract, but it does not dictate how the internal logic (yield strategy, fees, accounting) should be implemented.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use less bold emphasis - everywhere in the file, use only when it's actually needed

Comment thread primitives/vault/standard.mdx Outdated
withdraw(asset_amount: string, max_shares_deducted: string?, receiver_id: string?): string
```

Upon a successful withdrawal, the vault **must** emit a [`VaultWithdraw`](#events) event. Because transactions on NEAR are **non-atomic**, a vault should either:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move VaultWithdraw event description into the "Events" section below

Comment thread primitives/vault/standard.mdx Outdated

When implementing a vault, keep the following risks in mind:

- **Exchange rate manipulation (inflation attacks):** if the vault has a permissionless donation mechanism, an attacker can donate assets to inflate the share price and steal value from later depositors. Mitigate by seeding a non-trivial initial deposit and/or using a virtual decimal offset on issued shares (demonstrated in the reference implementation).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure that when you say "reference implementation", it has a link to it, so a reader isn't left wondering where it's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: NEW❗

Development

Successfully merging this pull request may close these issues.

[DOC] NEP-621: Tokenized Vault

2 participants