Nosana Pools
The Nosana Pools program allows users to open token pools with predefined emission rates.
Program Information
| Info | Description |
|---|---|
| Type | Solana Program |
| Source Code | GitHub |
| Build Status | Anchor Verified |
| Accounts | 2 |
| Instructions | 5 |
| Types | 1 |
| Errors | 5 |
| Domain | nosana-pools.sol |
| Address | nosPdZrfDzND1LAR28FLMDEATUPK53K8xbRBXAirevD |
Instructions
A number of 5 instruction are defined in the Nosana Pools program.
To load the program with Anchor.
const programId = new PublicKey('nosPdZrfDzND1LAR28FLMDEATUPK53K8xbRBXAirevD');
const idl = await Program.fetchIdl(programId.toString());
const program = new Program(idl, programId);Open
Open a PoolAccount and VaultAccount.
Account Info
The following 8 account addresses should be provided when invoking this instruction.
| Name | Type | Description |
|---|---|---|
pool | The PoolAccount address. | |
vault | The VaultAccount address. | |
beneficiary | The token account that will receive the emissions from the Pool. | |
authority | The signing authority of the program invocation. | |
mint | The token Mint address for this instruction. | |
systemProgram | The official Solana system program address. Responsible for system CPIs. | |
tokenProgram | The official SPL Token Program address. Responsible for token CPIs. | |
rent | The official Solana rent address. Responsible for lamports. |
Arguments
The following 4 arguments should also be provided when invoking this instruction.
| Name | Type | Size | Offset | Description |
|---|---|---|---|---|
emission | u64 | 8 | 0 | The emission rate for the pool, per second. |
startTime | i64 | 16 | 8 | The unix time the pool opens. |
claimType | u8 | 1 | 24 | The ClaimType for this pool. |
closeable | bool | 1 | 25 | Whether the pool should be closable or not. |
Solana Dispatch ID
The Solana dispatch ID for the Open Instruction is e4dc9b47c7bd3c2d, which can also be expressed as an 8 byte discriminator:
[228,220,155,71,199,189,60,45]Example with Anchor
To invoke the Open Instruction with Anchor TS.
let tx = await program.methods
.open(
emission, // type: u64
startTime, // type: i64
claimType, // type: u8
closeable, // type: bool
)
.accounts({
pool, // ✓ writable, ✓ signer
vault, // ✓ writable, 𐄂 signer
beneficiary, // 𐄂 writable, 𐄂 signer
authority, // ✓ writable, ✓ signer
mint, // 𐄂 writable, 𐄂 signer
systemProgram, // 𐄂 writable, 𐄂 signer
tokenProgram, // 𐄂 writable, 𐄂 signer
rent, // 𐄂 writable, 𐄂 signer
})
.signers([poolKey, authorityKey])
.rpc();Accounts
A number of 2 accounts make up for the Nosana Pools Program's state.
Pool Account
The PoolAccount struct holds all the information for any given pool. The total size of this account is 139 bytes.
| Name | Type | Size | Offset | Description |
|---|---|---|---|---|
authority | publicKey | 32 | 8 | The signing authority of the program invocation. |
beneficiary | publicKey | 32 | 40 | The token account that will receive the emissions from the Pool. |
claimType | u8 | 1 | 72 | The ClaimType for this pool. |
claimedTokens | u64 | 8 | 73 | The number of tokens that have been claimed. |
closeable | bool | 1 | 81 | Whether the pool should be closable or not. |
emission | u64 | 8 | 82 | The emission rate for the pool, per second. |
startTime | i64 | 16 | 90 | The unix time the pool opens. |
vault | publicKey | 32 | 106 | The VaultAccount address. |
vaultBump | u8 | 1 | 138 | The bump for the VaultAccount. |
Anchor Account Discriminator
The first 8 bytes, also known as Anchor's 8 byte discriminator, for the Pool Account are 74d2bb77c4c43489, which can also be expressed in byte array:
[116,210,187,119,196,196,52,137]Types
A number of 1 type variants are defined in the Nosana Pools Program's state.