pub enum PoolInstruction {
InitPool(InitArgs),
Deposit(u64),
Withdraw(u64),
Decide(bool),
}
Expand description
Instruction definition
Variants§
InitPool(InitArgs)
Initializes a new binary oracle pair pool.
[w]
Pool account.[]
Authority[]
Decider authority[]
Deposit currency SPL Token mint. Must be initialized.[w]
Deposit token account. Should not be initialized[w]
Token Pass mint. Should not be initialized[w]
Token Fail mint. Should not be initialized[]
Rent sysvar[]
Token program id
Deposit(u64)
Deposit into the pool.
[]
Pool[]
Authority[s]
User transfer authority[w]
Token SOURCE Account, amount is transferable by pool authority with allowances.[w]
Deposit token account[w]
token_P PASS mint[w]
token_F FAIL mint[w]
token_P DESTINATION Account[w]
token_F DESTINATION Account[]
Sysvar Clock[]
Token program id
Withdraw(u64)
Withdraw from the pool. If current slot is < mint_end slot, 1 Pass AND 1 Fail token convert to 1 deposit If current slot is > decide_end_slot slot && decide == Some(true), 1 Pass convert to 1 deposit otherwise 1 Fail converts to 1 deposit
Pass tokens convert 1:1 to the deposit token iff decision is set to Some(true) AND current slot is > decide_end_slot.
[]
Pool[]
Authority[s]
User transfer authority[w]
Pool deposit token account[w]
token_P PASS SOURCE Account[w]
token_F FAIL SOURCE Account[w]
token_P PASS mint[w]
token_F FAIL mint[w]
Deposit DESTINATION Account[]
Sysvar Clock[]
Token program id
Decide(bool)
Trigger the decision.
Call only succeeds once and if current slot > mint_end slot AND < decide_end slot
0. []
Pool
[s]
Decider pubkey[]
Sysvar Clock
Trait Implementations§
Source§impl BorshDeserialize for PoolInstruction
impl BorshDeserialize for PoolInstruction
Source§impl BorshSerialize for PoolInstruction
impl BorshSerialize for PoolInstruction
Source§impl Clone for PoolInstruction
impl Clone for PoolInstruction
Source§fn clone(&self) -> PoolInstruction
fn clone(&self) -> PoolInstruction
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PoolInstruction
impl Debug for PoolInstruction
Source§impl PartialEq for PoolInstruction
impl PartialEq for PoolInstruction
impl StructuralPartialEq for PoolInstruction
Auto Trait Implementations§
impl Freeze for PoolInstruction
impl RefUnwindSafe for PoolInstruction
impl Send for PoolInstruction
impl Sync for PoolInstruction
impl Unpin for PoolInstruction
impl UnwindSafe for PoolInstruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more