SELLER: Lists PT for sale on the market.
fn list_pt(env: soroban_sdk::Env, seller: soroban_sdk::Address, amount: i128)
SELLER: Lists YT for sale on the market.
fn list_yt(env: soroban_sdk::Env, seller: soroban_sdk::Address, amount: i128)
Initializes the marketplace with the necessary contract addresses. Call this immediately after deploying the contract.
fn initialize(
env: soroban_sdk::Env,
wrapper_address: soroban_sdk::Address,
usdc_address: soroban_sdk::Address,
)
BUYER: Automatically buys amount_needed of PT from available sellers.
Price: 0.97 USDC per PT.
fn buy_market_pt(
env: soroban_sdk::Env,
buyer: soroban_sdk::Address,
amount_needed: i128,
)
BUYER: Automatically buys amount_needed of YT from available sellers.
Price: 0.03 USDC per YT.
fn buy_market_yt(
env: soroban_sdk::Env,
buyer: soroban_sdk::Address,
amount_needed: i128,
)
Returns the amount of PT a specific user currently has listed for sale.
fn get_pt_listing(env: soroban_sdk::Env, seller: soroban_sdk::Address) -> i128
Returns the amount of YT a specific user currently has listed for sale.
fn get_yt_listing(env: soroban_sdk::Env, seller: soroban_sdk::Address) -> i128