Skip to content

Commit

Permalink
Merge pull request #316 from invariant-labs/update-docs
Browse files Browse the repository at this point in the history
Update A0 docs
  • Loading branch information
wojciech-cichocki authored Dec 5, 2023
2 parents 5194aa4 + a05aed9 commit c1b7a87
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/docs/aleph_zero/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The `Positions` struct is designed to manage positions associated with different

This documentation should help users understand the purpose of the `Positions` struct and how to use its functions effectively.

**Why Positions are Stored in State Instead of NFTs:**
**Why Positions are Stored in State Instead of NFTs?**

We have chosen to store positions in the state rather than using NFTs for several reasons:

Expand Down
15 changes: 8 additions & 7 deletions docs/docs/aleph_zero/listing_pool_to_azero.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
title: Listing pool to AZERO
title: Handling AZERO

slug: /aleph_zero/listing_pool_to_azero
---


### [Wrapped AZERO](https://github.com/Cardinal-Cryptography/wAZERO)
## What is [Wrapped AZERO](https://github.com/Cardinal-Cryptography/wAZERO)?

Wrapped coins and tokens virtually have the same value as their underlying assets. Therefore, wAZERO is the PSP22 compatible and tradable version of AZERO and can be used to interact with other AZERO assets.

## How to create pool to [wAZERO](https://github.com/Cardinal-Cryptography/wAZERO)

The Invariant Protocol enables token exchanges within the PSP22 token standard. To ensure compatibility with this interface, an additional action is required for the AZERO native cryptocurrency. Before depositing a token into a pool or a swap where the input token is AZERO, you must first wrap AZERO using the [wAZERO contract](https://github.com/Cardinal-Cryptography/wAZERO). The opposite procedure applies when withdrawing tokens or swapping, where wAZERO is the output token. In this scenario, it would be useful to unwrap the token.

The Invariant Protocol facilitates seamless token exchanges within the PSP22 standard, ensuring interoperability among compatible tokens.
To enable the exchange between PSP22 tokens and AZERO token, a pool is established between PSP22 tokens and WAZERO, a token that aligns with the PSP22 standard. This allow users to convert their PSP22 tokens to WAZERO before further exchanging them for the desired AZERO token.

## How to obtain [wAZERO](https://github.com/Cardinal-Cryptography/wAZERO)
- Deposit AZERO to mint wAZERO.
- Transfer wAZERO to your desired wallet.
29 changes: 15 additions & 14 deletions docs/docs/aleph_zero/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ slug: /aleph_zero/storage

This section provides an in-depth exploration of key data structures integral to the Aleph Zero protocol's storage mechanism. Understanding these structures is fundamental for developers and integrators working with the protocol.

## Contract state

```rust
pub struct State {
pub admin: AccountId,
pub protocol_fee: Percentage,
}
```
|Name|Type|Description|
|-|-|-|
|admin|AccountId|Account address of pool admin|
|protocol_fee|Percentage|Percentage of the fee collected upon every swap in the pool|


## FeeTier

```rust
Expand Down Expand Up @@ -114,17 +128,4 @@ pub struct Tick {
|sqrt_price|SqrtPrice|Square root of tick price|
|fee_growth_outside_x|FeeGrowth|Amount of Fees accumulated in token_x outside-range|
|fee_growth_outside_y|FeeGrowth|Amount of Fees accumulated in token_y outside-range|
|seconds_outside|u64|Seconds outside-range|

## State

```rust
pub struct State {
pub admin: AccountId,
pub protocol_fee: Percentage,
}
```
|Name|Type|Description|
|-|-|-|
|admin|AccountId|Account address of pool admin|
|protocol_fee|Percentage|Percentage of the fee collected upon every swap in the pool|
|seconds_outside|u64|Seconds outside-range|
2 changes: 1 addition & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = {
type: 'category',
label: 'Aleph Zero',
collapsed: true,
items: ['aleph_zero/installation', 'aleph_zero/overview', 'aleph_zero/types', 'aleph_zero/storage', 'aleph_zero/collections', 'aleph_zero/entrypoints', 'aleph_zero/invariant_errors', 'aleph_zero/listing_pool_to_azero',]
items: ['aleph_zero/installation', 'aleph_zero/overview', 'aleph_zero/types', 'aleph_zero/storage', 'aleph_zero/collections', 'aleph_zero/entrypoints', 'aleph_zero/listing_pool_to_azero', 'aleph_zero/invariant_errors',]
},
'faq',
'resources',
Expand Down

1 comment on commit c1b7a87

@vercel
Copy link

@vercel vercel bot commented on c1b7a87 Dec 5, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.