forked from djeck1432/spotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterfaces.cairo
69 lines (58 loc) · 2.35 KB
/
interfaces.cairo
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
use ekubo::types::keys::PoolKey;
use spotnet::types::{
MarketReserveData, DepositData, Claim, EkuboSlippageLimits, TokenPrice, TokenAmount
};
use starknet::ContractAddress;
#[starknet::interface]
pub trait IDeposit<TContractState> {
fn loop_liquidity(
ref self: TContractState,
deposit_data: DepositData,
pool_key: PoolKey,
ekubo_limits: EkuboSlippageLimits,
pool_price: TokenPrice
);
fn close_position(
ref self: TContractState,
supply_token: ContractAddress,
debt_token: ContractAddress,
pool_key: PoolKey,
ekubo_limits: EkuboSlippageLimits,
borrow_portion_percent: u8,
supply_price: TokenPrice,
debt_price: TokenPrice
);
fn claim_reward(
ref self: TContractState,
claim_data: Claim,
proof: Span<felt252>,
airdrop_addr: ContractAddress
);
fn extra_deposit(ref self: TContractState, token: ContractAddress, amount: TokenAmount);
fn withdraw(ref self: TContractState, token: ContractAddress, amount: TokenAmount);
fn is_position_open(self: @TContractState) -> bool;
}
#[starknet::interface]
pub trait IMarket<TContractState> {
fn get_reserve_data(self: @TContractState, token: ContractAddress) -> MarketReserveData;
fn get_user_debt_for_token(
self: @TContractState, user: ContractAddress, token: ContractAddress
) -> felt252;
fn deposit(ref self: TContractState, token: ContractAddress, amount: felt252);
fn borrow(ref self: TContractState, token: ContractAddress, amount: felt252);
fn enable_collateral(ref self: TContractState, token: ContractAddress);
fn disable_collateral(ref self: TContractState, token: ContractAddress);
fn withdraw(ref self: TContractState, token: ContractAddress, amount: felt252);
fn withdraw_all(ref self: TContractState, token: ContractAddress);
fn repay(ref self: TContractState, token: ContractAddress, amount: felt252);
fn repay_all(ref self: TContractState, token: ContractAddress);
}
#[starknet::interface]
pub trait IAirdrop<TContractState> {
fn claim(ref self: TContractState, claim: Claim, proof: Span<felt252>) -> bool;
}
#[starknet::interface]
pub trait IVault<TContractState> {
fn store_liquidity(ref self: TContractState, amount: TokenAmount);
fn withdraw_liquidity(ref self: TContractState, amount: TokenAmount);
}