-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcidl.yaml
98 lines (95 loc) · 2.31 KB
/
cidl.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
cidl: "0.8"
info:
name: paypeer
title: Paypeer
version: 0.0.1
summary: |-
The purpose of this contract is to create a stable curve based pool for swaps on solana.
reference math:
- [Understanding StableSwap Curve](https://miguelmota.com/blog/understanding-stableswap-curve/)
contact:
name: ajibola ojo
web: https://github.com/jbrit/
email: [email protected]
git: https://github.com/jbrit/rspaypeer
license:
name: MIT
url: https://opensource.org/license/mit
types:
SwapAuthority:
solana:
owner: self
seeds:
- name: swapauthority
fields:
- name: random
type: u8
Pool:
summary: store the relevant information to track the info for the pool.
solana:
owner: self
seeds:
- name: pool
fields:
- name: ngn
type: sol:pubkey
- name: usd
type: sol:pubkey
methods:
- name: set_pool
summary: Initialize a Pool account for this contract.
solana:
signers:
- name: fee_payer
inputs:
- name: swap_authority
type: SwapAuthority
solana:
attributes: [ mut, init_if_needed ]
signers:
signer: fee_payer
- name: pool
type: Pool
solana:
attributes: [ mut, init_if_needed ]
signers:
signer: fee_payer
- name: ngn_mint
type: sol:pubkey
- name: usd_mint
type: sol:pubkey
- name: swap
summary: Initialize Swap
inputs:
- name: amount_in
type: u64
- name: min_amount_out
type: u64
- name: pool
type: Pool
- name: token_program
type: sol:account_info
- name: user_authority
type: sol:account_info
- name: user_source
type: sol:account_info
solana:
attributes: [ mut ]
- name: user_destination
type: sol:account_info
solana:
attributes: [ mut ]
- name: swap_authority
type: SwapAuthority
solana:
attributes: [ mut, init_if_needed ]
signers:
signer: fee_payer
- name: swap_source
type: sol:account_info
solana:
attributes: [ mut ]
- name: swap_destination
type: sol:account_info
solana:
attributes: [ mut ]